How to delete multivalue fields that do not match my query from the result?

Asked

Viewed 91 times

4

I have some documents indexed as the below:

{
  "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"
      ]
}

When I search for "ho hum," I need the returned document to be something like:

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

Then I can know exactly which page contains the words I was looking for. How can I do this?

In other words... How do I delete from the result the multivalue fields that don’t match my query?

NOTE: Solr-4.10.2 and a data-import (db-data-config.xml) from my SQL Server database.

1 answer

1


There is an open ticket in Solr’s Jira since 2012 for the development of this feature, but it is still open and unresolved.

Solr: Return only Matched multiValued field

For now this is not yet possible to be done with the native Solr.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.