I also would like to know the answer to this. But my feeling is that you can't do what you want. I also had to use the highlighting workaround and aggregate dynamic field to accomplish the inability of multivalued fields to accommodate it.
On Mon, 12 Sep 2011 11:44:01 -0400, Rahul Warawdekar <rahul.warawde...@gmail.com> wrote: > Hi, > > I have a a query on Solr search as follows. > > I am indexing an entity which includes a multivalued field using DIH. > This multivalued field contains content from multiple attachments for > a single entity. > > Now, for eg. if i search for the term "solr", will I be able to know > which field contains this search term ? > And if it is a multivaued field, which field number in that > multivalued field contains the search term ? > > Currently, to achieve this, I am using a workaround using the > highlighting feature. > I am indexing all the multiple attachments within a single entity and > document as dynamic fields "<attachment_id>_i". > > While searching, I am highlighting on these dynamic fields (hl.fl=*_i) > and from the highlighitng section in the results, I am able to get the > attachment number which contains the search term. > But since this approach involves highlighting large attachments, the > search response times are very slow. > > Would highly appreciate if someone can suggest other efficient ways to > address this kind of a requirement.