Solr - Differentiating between exact match and Partial Match OR grouping based on scores

时光总嘲笑我的痴心妄想 提交于 2019-12-11 16:37:01

问题


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?

来源:https://stackoverflow.com/questions/50564654/solr-differentiating-between-exact-match-and-partial-match-or-grouping-based-o

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!