/// <summary> Defines an analyzer to use for the specified Field.
		/// 
		/// </summary>
		/// <param name="fieldName">Field name requiring a non-default analyzer.
		/// </param>
		/// <param name="analyzer">non-default analyzer to use for Field
		/// </param>
		public virtual void  AddAnalyzer(System.String fieldName, Analyzer analyzer)
		{
			analyzerMap[fieldName] = analyzer;
		}
		/// <summary> Constructs with default analyzer.
		/// 
		/// </summary>
		/// <param name="defaultAnalyzer">Any fields not specifically
		/// defined to use a different analyzer will use the one provided here.
		/// </param>
		public PerFieldAnalyzerWrapper(Analyzer defaultAnalyzer)
		{
			this.defaultAnalyzer = defaultAnalyzer;
		}
Beispiel #3
0
 /// <summary> Note that parameter analyzer is ignored. Calls inside the parser always
 /// use class member analyser. This method will be deprecated and substituted
 /// by {@link #GetRangeQuery(String, String, String, boolean)} in future versions of Lucene.
 /// Currently overwriting either of these methods works.
 /// 
 /// </summary>
 /// <exception cref=""> ParseException throw in overridden method to disallow
 /// </exception>
 protected internal virtual Query GetRangeQuery(System.String field, Analyzer analyzer, System.String part1, System.String part2, bool inclusive)
 {
     return GetRangeQuery(field, part1, part2, inclusive);
 }
Beispiel #4
0
 /// <summary> Base implementation delegates to {@link #GetFieldQuery(String, Analyzer, String)}.
 /// This method may be overwritten, for example, to return
 /// a SpanNearQuery instead of a PhraseQuery.
 /// 
 /// Note that parameter analyzer is ignored. Calls inside the parser always
 /// use class member analyser. This method will be deprecated and substituted
 /// by {@link #GetFieldQuery(String, String, int)} in future versions of Lucene.
 /// Currently overwriting either of these methods works.
 /// 
 /// </summary>
 /// <exception cref=""> ParseException throw in overridden method to disallow
 /// </exception>
 protected internal virtual Query GetFieldQuery(System.String field, Analyzer analyzer, System.String queryText, int slop)
 {
     return GetFieldQuery(field, queryText, slop);
 }
Beispiel #5
0
		/// <summary>Constructs a query parser.</summary>
		/// <param name="f"> the default Field for query terms.
		/// </param>
		/// <param name="a">  used to find terms in the query text.
		/// </param>
		public QueryParser(System.String f, Analyzer a) : this(new FastCharStream(new System.IO.StringReader("")))
		{
			analyzer = a;
			field = f;
		}
Beispiel #6
0
		/// <summary>Parses a query string, returning a {@link Monodoc.Lucene.Net.Search.Query}.</summary>
		/// <param name="query"> the query string to be parsed.
		/// </param>
		/// <param name="field"> the default Field for query terms.
		/// </param>
		/// <param name="analyzer">  used to find terms in the query text.
		/// </param>
		/// <throws>  ParseException if the parsing fails </throws>
		static public Query Parse(System.String query, System.String field, Analyzer analyzer)
		{
			QueryParser parser = new QueryParser(field, analyzer);
			return parser.Parse(Escape(query));
		}