Utility class used to extract the terms used in a query, plus any weights. This class will not find terms for MultiTermQuery, RangeQuery and PrefixQuery classes so the caller must pass a rewritten query (see Query.rewrite) to obtain a list of expanded terms.
示例#1
0
 /// <param name="query">
 /// a Lucene query (ideally rewritten using <see cref="Query.Rewrite(IndexReader)"/> before
 /// being passed to this class and the searcher)
 /// </param>
 /// <param name="fieldName">the Field name which is used to match Query terms</param>
 public QueryTermScorer(Query query, string fieldName)
     : this(QueryTermExtractor.GetTerms(query, false, fieldName))
 {
 }
示例#2
0
 /// <param name="query">
 /// a Lucene query (ideally rewritten using <see cref="Query.Rewrite(IndexReader)"/> before
 /// being passed to this class and the searcher)
 /// </param>
 /// <param name="reader">
 /// used to compute IDF which can be used to a) score selected
 /// fragments better b) use graded highlights eg set font color
 /// intensity
 /// </param>
 /// <param name="fieldName">
 /// the field on which Inverse Document Frequency (IDF)
 /// calculations are based
 /// </param>
 public QueryTermScorer(Query query, IndexReader reader, string fieldName)
     : this(QueryTermExtractor.GetIdfWeightedTerms(query, reader, fieldName))
 {
 }
示例#3
0
 /// <param name="query">
 /// a Lucene query (ideally rewritten using <see cref="Query.Rewrite(IndexReader)"/> before
 /// being passed to this class and the searcher)
 /// </param>
 public QueryTermScorer(Query query)
     : this(QueryTermExtractor.GetTerms(query))
 {
 }