简体   繁体   中英

How do I search set of keywords from keywords field in Solr?

So I have a keyword field with this schema Indexed, Tokenized, Multivalued, TermVector Stored, Omit Norms

then I wanna search set of keywords against it like

q=keyword:keyword1, keyword2, keyword3, etc, etc

and want to return most matching keywords, even 1 match keyword is fine, but ordered by most match.

thank you

q=keyword:(keyword1 OR keyword2 OR keyword3 OR...)

Solr will give a higher score to the documents that match more keywords so they will be the first results. You can see the assigned score by appending &fl=*,score to your querystring.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM