Esempio n. 1
0
 private void  Init(System.IO.TextReader input, Version matchVersion)
 {
     if (matchVersion.OnOrAfter(Version.LUCENE_24))
     {
         Init(input, true);
     }
     else
     {
         Init(input, false);
     }
 }
Esempio n. 2
0
 private void  Init(Version matchVersion)
 {
     SetOverridesTokenStreamMethod(typeof(StandardAnalyzer));
     if (matchVersion.OnOrAfter(Version.LUCENE_29))
     {
         enableStopPositionIncrements = true;
     }
     else
     {
         useDefaultStopPositionIncrements = true;
     }
     if (matchVersion.OnOrAfter(Version.LUCENE_24))
     {
         replaceInvalidAcronym = defaultReplaceInvalidAcronym;
     }
     else
     {
         replaceInvalidAcronym = false;
     }
 }
Esempio n. 3
0
 /// <summary> Returns version-dependent default for enablePositionIncrements. Analyzers
 /// that embed StopFilter use this method when creating the StopFilter. Prior
 /// to 2.9, this returns {@link #getEnablePositionIncrementsDefault}. On 2.9
 /// or later, it returns true.
 /// </summary>
 public static bool GetEnablePositionIncrementsVersionDefault(Version matchVersion)
 {
     if (matchVersion.OnOrAfter(Version.LUCENE_29))
     {
         return(true);
     }
     else
     {
         return(ENABLE_POSITION_INCREMENTS_DEFAULT);
     }
 }
Esempio n. 4
0
		private void  Init(System.IO.TextReader input, Version matchVersion)
		{
			if (matchVersion.OnOrAfter(Version.LUCENE_24))
			{
				Init(input, true);
			}
			else
			{
				Init(input, false);
			}
		}
Esempio n. 5
0
		/// <summary> Constructs a query parser.
		/// 
		/// </summary>
		/// <param name="matchVersion">Lucene version to match. See <a href="#version">above</a>)
		/// </param>
		/// <param name="f">the default field for query terms.
		/// </param>
		/// <param name="a">used to find terms in the query text.
		/// </param>
		public QueryParser(Version matchVersion, System.String f, Analyzer a):this(new FastCharStream(new System.IO.StringReader("")))
		{
			analyzer = a;
			field = f;
			if (matchVersion.OnOrAfter(Version.LUCENE_29))
			{
				enablePositionIncrements = true;
			}
			else
			{
				enablePositionIncrements = false;
			}
		}
		private void  Init(Version matchVersion)
		{
			SetOverridesTokenStreamMethod(typeof(StandardAnalyzer));
			if (matchVersion.OnOrAfter(Version.LUCENE_29))
			{
				enableStopPositionIncrements = true;
			}
			else
			{
				useDefaultStopPositionIncrements = true;
			}
			if (matchVersion.OnOrAfter(Version.LUCENE_24))
			{
				replaceInvalidAcronym = defaultReplaceInvalidAcronym;
			}
			else
			{
				replaceInvalidAcronym = false;
			}
		}
Esempio n. 7
0
		/// <summary> Returns version-dependent default for enablePositionIncrements. Analyzers
		/// that embed StopFilter use this method when creating the StopFilter. Prior
		/// to 2.9, this returns {@link #getEnablePositionIncrementsDefault}. On 2.9
		/// or later, it returns true.
		/// </summary>
		public static bool GetEnablePositionIncrementsVersionDefault(Version matchVersion)
		{
			if (matchVersion.OnOrAfter(Version.LUCENE_29))
			{
				return true;
			}
			else
			{
				return ENABLE_POSITION_INCREMENTS_DEFAULT;
			}
		}