By default QueryParser uses {@link MultiTermQuery#CONSTANT_SCORE_AUTO_REWRITE_DEFAULT} when creating a PrefixQuery, WildcardQuery or RangeQuery. This implementation is generally preferable because it a) Runs faster b) Does not have the scarcity of terms unduly influence score c) avoids any "TooManyBooleanClauses" exception. However, if your application really needs to use the old-fashioned BooleanQuery expansion rewriting and the above points are not relevant then use this to change the rewrite method.

Namespace: Lucene.Net.QueryParsers
Assembly: Lucene.Net (in Lucene.Net.dll) Version: 2.9.4.1

Syntax

C#
public virtual void SetMultiTermRewriteMethod(
	MultiTermQuery..::..RewriteMethod method
)
Visual Basic
Public Overridable Sub SetMultiTermRewriteMethod ( _
	method As MultiTermQuery..::..RewriteMethod _
)
Visual C++
public:
virtual void SetMultiTermRewriteMethod(
	MultiTermQuery..::..RewriteMethod^ method
)

Parameters

method
Type: Lucene.Net.Search..::..MultiTermQuery..::..RewriteMethod

[Missing <param name="method"/> documentation for "M:Lucene.Net.QueryParsers.QueryParser.SetMultiTermRewriteMethod(Lucene.Net.Search.MultiTermQuery.RewriteMethod)"]

See Also