lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jack Krupansky <>
Subject Re: Search over a multiValued field
Date Tue, 03 Mar 2015 21:58:49 GMT
Just set the positionIncrementGap for the multivalued field to a much
higher value, like 1000 or 5000. That's the purpose of this attribute, to
assure that reasonable proximity matches don't match across multiple values.

Also, leave "AND" out of the query phrases - you're just trying to match
the product name and availability.

-- Jack Krupansky

On Tue, Mar 3, 2015 at 4:51 PM, Tom Devel <> wrote:

> Hi,
> I am running Solr 5.0.0 and have a question about proximity search and
> multiValued fields.
> I am indexing xml files of the following form with foundField being a field
> defined as multiValued and text_en my in schema.xml.
> <?xml version="1.0" encoding="UTF-8"?>
> <add><doc>
> <field name="id">8</field>
> <field name="foundField">"Oranges from South California - ordered"</field>
> <field name="foundField">"Green Apples - available"</field>
> <field name="foundField">"Black Report Books - ordered"</field>
> </doc></add>
> There are several such documents, and for instance, I would like to query
> all documents having in the foundField "Oranges" and "ordered". The
> following proximity query takes care of it:
> q=foundField:("oranges AND ordered"~2)
> However, a field could have more words, and I also cannot know the
> proximity of the desired query words in advance. Setting the proximity
> value too high results in false positives, the following query also returns
> the document (although "available" was in the entry about Apples):
> foundField:("oranges AND available"~200)
> I do not think that tweaking a proximity value is the correct approach.
> How can I search to match contents in a multiValued field per Value as
> described above, without running into the problem?
> Many thanks for any help

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message