开发者

FuzzyQuery and BooleanQuery

I work with Hibernate Search 3.1.1.GA.

I am trying my luck at fuzzy queries. This query works (it retrieves records containing Shakespeare):

lastName:shakespere~0.1

But this one does not:

firstName:shakespere~0.1 lastName:shakesper开发者_运维技巧e~0.1

I create a BooleanQuery and stuff it with FuzzyQuery instances with Occur.SHOULD. Wrapping the FuzzyQuery instances in BooleanClause does not seem to make a difference. Any hint?

Thanks,

Francois


I'm not sure this is what you need, try take a look at [MultiFieldQueryParser][1]

[1]: http://lucene.apache.org/java/2_4_0/api/org/apache/lucene/queryParser/MultiFieldQueryParser.html#MultiFieldQueryParser(java.lang.String[], org.apache.lucene.analysis.Analyzer)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜