문제

I have this query: +document_type: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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top