How do I exclude from the result the multivalue fields that do not match my query?

4

I have some indexed documents like the one 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"
       ]
}

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

In other words ... How do I exclude from the result the multivalue fields that do not match my query?

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

    
asked by anonymous 17.11.2014 / 20:15

1 answer

1

There is a ticket open in Solr's JIRA since 2012 for the development of this functionality, but it is still open and unsolved.

Solr: Return only matched multiValued field

For the time being this is still not possible with native Solr.

    
11.06.2015 / 04:57