lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "White, Bill" <>
Subject Re: fq syntax for requiring all multiValued field values to be within a list?
Date Sat, 27 Sep 2014 20:15:38 GMT
OK, let me try phrasing it better.

How do I exclude from search, any result which contains any value for
multivalued field 'color' which is not within a given "constraint set"
(e.g., "red", "green", "yellow", "burnt sienna"), given that I do not what
any of the other possible values of 'color' are?

In pseudocode:

for all x in result.color
    if x not in ("red","green","yellow", "burnt sienna")
        filter out result

I don't see how range queries would work since I have no control over the
possible values of 'color', e.g., there could be a valid color "lemon
yellow" between "green" and "red", and I don't want a result which has
(color: red, color: "lemon yellow")

On Sat, Sep 27, 2014 at 4:02 PM, Mikhail Khludnev <> wrote:

> On Sat, Sep 27, 2014 at 11:36 PM, White, Bill <> wrote:
> > but do NOT match ANY other color.
> Bill, I miss the whole picture, it's worth to rephrase the problem in one
> sentence.
> But regarding the quote above, you can try to use exclusive ranges
> fq=-color:({* TO green} {green TO red} {red TO *})
> just don't forget to build ranges alphabetically
> --
> Sincerely yours
> Mikhail Khludnev
> Principal Engineer,
> Grid Dynamics
> <>
> <>

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