Table of Contents

Class ErrorCheckingScoringBooleanQueryRewrite

Namespace
Examine.Lucene.Providers
Assembly
Examine.Lucene.dll

This is a work around for the TooManyClauses exception when rewriting wildcard queries

[Serializable]
public class ErrorCheckingScoringBooleanQueryRewrite : MultiTermQuery.RewriteMethod
Inheritance
MultiTermQuery.RewriteMethod
ErrorCheckingScoringBooleanQueryRewrite
Inherited Members
MultiTermQuery.RewriteMethod.GetTermsEnum(MultiTermQuery, Terms, AttributeSource)

Remarks

If a user wishes to turn on rewriting for wildcard queries and doesn't care about performance implications and to automatically just ignore these exceptions and use the default rewriter (non scoring), this syntax can be used:

var criteria = searcher.CreateSearchCriteria(); var luceneCriteria = (LuceneSearchCriteria)criteria; luceneCriteria.QueryParser.SetMultiTermRewriteMethod(BaseLuceneSearcher.ErrorCheckingScoringBooleanQueryRewriteInstance); //Continue using the 'criteria' object to build up the query

Methods

Rewrite(IndexReader, MultiTermQuery)

public override Query Rewrite(IndexReader reader, MultiTermQuery query)

Parameters

reader IndexReader
query MultiTermQuery

Returns

Query