Unfortunately, no. Multivalued fields are a great and powerful, but very simple feature, with the emphasis on simplicity. There are all sorts of hacks that you can use to get around that limitation, but no direct feature for "nested documents".

1. You can form a composite string: "home: 052323232323".
2. Use tokenized text with a composite string, and then a query on the raw phone number would still match. 3. Make phone numbers their own documents, with a (multivalued?) "owner" field. Sure, it then requires a second query, but... 4. Use a JSON string to represent a composite structure. And if you make it tokenized text, you can still query on the raw phone number.

-- Jack Krupansky

-----Original Message----- From: manju16832003
Sent: Monday, August 12, 2013 5:05 AM
To: solr-user@lucene.apache.org
Subject: multiValued : How do I specify name to each value returned by multiValue field.

Hi All,
I have a multiValued field, and it returns the result in the following
manner

<doc>
<str name="fname">Micheal</str>
<str name="lname">Schumacher</str>
<arr name="phones">
   <str>090933434343</str>
   <str>052323232323</str>
   <str>073628362782</str>
</arr>
</doc>

In the above document phones is multiValued and it works fine :-). However I
would like to name each row in the 'phones' with meaningful names like
<doc>
<str name="fname">Micheal</str>
<str name="lname">Schumacher</str>
<arr name="phones">
   *<str name="mobile">*090933434343</str>
   *<str "home">*052323232323</str>
   *<str "office">*073628362782</str>
</arr>
</doc>

any suggestions



--
View this message in context: http://lucene.472066.n3.nabble.com/multiValued-How-do-I-specify-name-to-each-value-returned-by-multiValue-field-tp4083922.html Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to