Use a field called "option_value_pairs" with values like "A 200" and then query with a quoted phrase "A 200".

You could use a special character like equal sign instead of space: "A=200" and then you don't have to quote it in the query.

-- Jack Krupansky

-----Original Message----- From: Torben Honigbaum
Sent: Thursday, October 04, 2012 11:03 AM
To: solr-user@lucene.apache.org
Subject: Problem with relating values in two multi value fields

Hello,

I've a problem with relating values in two multi value fields. My documents look like this:

<doc>
 <str name="id">3</str>
 <str name="options">
   <str>A</str>
   <str>B</str>
   <str>C</str>
   <str>D</str>
 <str>
 <str name="value">
   <str>200</str>
   <str>400</str>
   <str>240</str>
   <str>310</str>
 <str>
</doc>

My problem is that I've to search for a set of documents and display only the value for option A, for example, and use the value field as facet field. I need a result like this:

<doc>
 <str name="id">3</str>
 <str name="options">A</str>
 <str name="value">200</str>
</doc>
<facet> …

I think that this is a use case which isn't possible, right? So can someone show me an alternative way to solve this problem? The documents each have 500 options with 500 related values.

Thank you
Torben

Reply via email to