开发者

Why Zend Lucene returns all hits if nothing is found?

开发者 https://www.devze.com 2023-04-09 23:06 出处:网络
I have this query: +document_t开发者_JAVA技巧ype:client name:something to search and if something to search is not found the Zend Lucene returns all documents containing +document_type:client and I wo

I have this query: +document_t开发者_JAVA技巧ype:client name:something to search and if something to search is not found the Zend Lucene returns all documents containing +document_type:client and I would like to return empty set.

I've tried to add AND operator between terms, but result is the same.

What I'ma doing wrong?


If you want to ensure both comparisons are matched,
you can applied + to both comparisons

+document_type:client +name:some_value

OR

+(document_type:client name:some_value)

Take a look on

<solrQueryParser defaultOperator="OR"/> <-- change it to AND
0

精彩评论

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