Considering Lucene level every term in the document field is attributed by
positions (if you don't omit them) i.e. your document looks like ["red"@0,
"redder"@1, "reddest"@2,"yellow"@3, "blue"@4]
pls check the info PhraseQuery, SpanQueries and positionIncrementGap.
I have an experience of obtaining the matched spans (positions) from
SpanQueries
http://blog.griddynamics.com/2011/10/solr-experience-search-parent-child.html
But I suppose you need something much more out-of-the-box. Have you check
highlighting support in Solr - it looks like what you
need. Unfortunately I've never deal with highlighting.

Good luck

On Sat, Jan 28, 2012 at 10:45 AM, Travis Low <t...@4centurion.com> wrote:

> If a query matches one or more values of a multivalued field, is it
> possible to get the indexes back for WHICH values?  For example, for a
> document with a multivalue field having ["red", "redder", "reddest",
> "yellow", "blue"] as its value, if "red" is the query, could we know that
> values 0,1, and 2 matched?
>
> Against all hope, if that's "yes", then the next question is, would the
> values be listed in the order they were specified when adding the document?
>
> The idea here is that each document may have a variable number of multiple
> external (e.g. Word) documents associated with it, and for any match, we
> not only want to provide a link to the Solr document, but also, be able to
> tell the user which external documents matched.  The contents of these
> documents would populate the multivalued field (a very big field).
>
> If that can't be done, I think what we'll do is do some kind of prefixed
> hash of the document name and embed that in each mutlivalued field value
> (each document content).  The prefix would contain (or be another hash of)
> the document id.  Then we could find which documents matched, could we
> not?
>
> Sorry if this is a dumb question.  I've asked about this before, and
> received some *very* useful input (thanks!) but nothing that has yet lead
> me to a robust solution for indexing a set of records along with their
> associated documents and being able to identify the matching record AND the
> matching document(s).
>
> Thanks for your help!
>
> cheers,
> Travis
>
> --
>
> **
>
> *Travis Low, Director of Development*
>
>
> ** <t...@4centurion.com>* *
>
> *Centurion Research Solutions, LLC*
>
> *14048 ParkEast Circle *•* Suite 100 *•* Chantilly, VA 20151*
>
> *703-956-6276 *•* 703-378-4474 (fax)*
>
> *http://www.centurionresearch.com* <http://www.centurionresearch.com>
>
> **The information contained in this email message is confidential and
> protected from disclosure.  If you are not the intended recipient, any use
> or dissemination of this communication, including attachments, is strictly
> prohibited.  If you received this email message in error, please delete it
> and immediately notify the sender.
>
> This email message and any attachments have been scanned and are believed
> to be free of malicious software and defects that might affect any computer
> system in which they are received and opened. No responsibility is accepted
> by Centurion Research Solutions, LLC for any loss or damage arising from
> the content of this email.
>



-- 
Sincerely yours
Mikhail Khludnev
Lucid Certified
Apache Lucene/Solr Developer
Grid Dynamics

<http://www.griddynamics.com>
 <mkhlud...@griddynamics.com>

Reply via email to