简体   繁体   English

查询与主实体无关的特定多值字段

[英]query a specific multivalue field irespective to main entity

So I have two table in my database. 所以我的数据库中有两个表。

  1. user (user_id pk,user_name,....). 用户(user_id pk,user_name,....)。
  2. education(id pk, user_id, college_name). 教育程度(id pk,user_id,college_name)。

and following is the index data of solr storing. 以下是solr存储的索引数据。

docs": [
      {
        "name": "Deepesh",
        "id": "1",
        "college_name": [
          "Jamnakhal",
          "Messmore",
          "IMS"
        ],
        "_version_": 1541716111356067800
      },
      {
        "name": "Uniyal",
        "id": "2",
        "college_name": [
          "J. I. C.",
          "ABC",
          "BCD"
        ],
        "_version_": 1541716111356067800
      },

The full data searching is ok, but now I have 1 more requirment for autofill search box for college_name, so I am using EdgeNGramFilterFactory is solr for college_name column and also multiValue is true. 完整的数据搜索是可以的,但是现在我对College_name的自动填充搜索框还有1个要求,因此我使用EdgeNGramFilterFactorycollege_name列使用solr,并且multiValue是true。

but now when I am trying to search J , it returning me the array of all the college name corresponding to user. 但是现在当我尝试搜索J时 ,它返回给我与用户对应的所有大学名称的数组。

this is ok in which term I have stored data in solr. 没关系,我用solr来存储数据。 but how can I solve my 2nd problem for autoFill, if I search college name J then it should return me only college names. 但是我该如何解决第二个自动填充问题,如果我搜索大学名称J,那么它应该只返回我的大学名称。

docs": [ { "college_name": "Jamnakhal" " version ": 1541716111356067800 }, { "college_name": "JIC" " version ": 1541716111356067801 }, docs”:[{“ colege_name”:“ Jamnakhal”“ 版本 ”:1541716111356067800},{“ college_name”:“ JIC”“ 版本 ”:1541716111356067801},

Solr返回匹配的文档,在上述情况下,如果Collage_name与Jamnakhal匹配,则将返回文档1或spacefic字段,而不仅仅是Jamnakhal。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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