开发者

FuzzyQuery and BooleanQuery

开发者 https://www.devze.com 2023-01-23 19:26 出处:网络
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):

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

精彩评论

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