Solr - Differentiating between exact match and Par

2019-08-27 18:55发布

问题:

In my current Solr search implementation, I get results based on scores - which is fine.

However, I want to create two groups from the results. The first group should be a relevant group (when all the query words are present in the document) and the second group should be the related group (when only partial words from query exist in the document).

"response":{"numFound":206,"start":0,"maxScore":11.856699,"docs":[
      {
        "Product":["KW Cyber Security Digital Product"],
        "score":11.856699},
      {
        "Product":["Cyber Security Extension"],
        "score":11.856699},
      {
        "Product":["Cyber Security staffing"],
        "score":11.856699},
      {
        "Product":["Cyber Forensics"],
        "score":8.755427},
      {
        "Product":["Cyber"],
        "score":7.868184},]

In the above search query &q=cyber security. The first three products are relevant to me (because both the terms "cyber" and "security" exists while the rest are related (as only the term "cyber" exist"

How do I group them so that I can parse relevant and related separately?