簡體   English   中英

Solr-如何從結果中排除與查詢不匹配的多值字段?

[英]solr - How can I exclude from the result the multivalue fields that don't match my query?

我有一些上面的索引文件:

{
  "doc_desc": "Indexing Child Documents in JSON",
  "doc_id": "379",
  "image_id": [
          "28086# ho hum... this is page 1 of chapter 1",
          "28087# more text... this is page 2 of chapter 1",
          "28088# more text... this is page 3 of chapter 1"
      ]
}

當我查詢“哼哼”時,我需要返回的文檔是這樣的:

{
      "doc_desc": "Indexing Child Documents in JSON",
      "doc_id": "379",
      "image_id": [
              "28086# ho hum... this is page 1 of chapter 1"
       ]
}

因此,我可以確切知道包含我要搜索的單詞的頁面。 我怎樣才能做到這一點?

換句話說...如何從結果中排除與查詢不匹配的多值字段?

OBS:我正在使用solr-4.10.2和SQL Server數據庫中的數據導入(db-data-config.xml)。

您不能,至少不能沒有很多手動修改。

兩種可能的解決方案是將每個頁面作為單獨的文檔編制索引,或者使用Solr的“塊聯接”功能 第一個選項可能是最快實施的。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM