Example #1
0
 private void  Init(System.IO.TextReader input, Version matchVersion)
 {
     if (matchVersion.OnOrAfter(Version.LUCENE_24))
     {
         replaceInvalidAcronym = true;
     }
     else
     {
         replaceInvalidAcronym = false;
     }
     this.input = input;
     termAtt    = AddAttribute <ITermAttribute>();
     offsetAtt  = AddAttribute <IOffsetAttribute>();
     posIncrAtt = AddAttribute <IPositionIncrementAttribute>();
     typeAtt    = AddAttribute <ITypeAttribute>();
 }
		private void  Init(System.IO.TextReader input, Version matchVersion)
		{
			if (matchVersion.OnOrAfter(Version.LUCENE_24))
			{
			    replaceInvalidAcronym = true;
			}
			else
			{
			    replaceInvalidAcronym = false;
			}
		    this.input = input;
		    termAtt = AddAttribute<ITermAttribute>();
		    offsetAtt = AddAttribute<IOffsetAttribute>();
		    posIncrAtt = AddAttribute<IPositionIncrementAttribute>();
		    typeAtt = AddAttribute<ITypeAttribute>();
		}
Example #3
0
        /* Constructs a query parser.
         *  @param matchVersion  Lucene version to match.  See <a href="#version">above</a>)
         *  @param f  the default field for query terms.
         *  @param a   used to find terms in the query text.
         */

        public QueryParser(Version matchVersion, String f, Analyzer a)
            : this(new FastCharStream(new StringReader("")))
        {
            analyzer = a;
            field = f;
            if (matchVersion.OnOrAfter(Version.LUCENE_29))
            {
                enablePositionIncrements = true;
            }
            else
            {
                enablePositionIncrements = false;
            }

            // LUCENENET-423 - DateRange differences with Java and .NET
            if (matchVersion.OnOrAfter(Version.LUCENE_30))
            {
                _useJavaStyleDateRangeParsing = true;
            }
        }