Query for records that have more than N values in a multi-valued field

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Query for records that have more than N values in a multi-valued field

Alexandre Rafalovitch
Hello,

I have a multivalued field and I want to find records that have (for
example) at least 3 values in that list. Is there an easy way to do
it?

Regards,
   Alex.
Personal blog: http://blog.outerthoughts.com/
LinkedIn: http://www.linkedin.com/in/alexandrerafalovitch
- Time is the quality of nature that keeps events from happening all
at once. Lately, it doesn't seem to be working.  (Anonymous  - via GTD
book)
Reply | Threaded
Open this post in threaded view
|

Re: Query for records that have more than N values in a multi-valued field

Mikhail Khludnev
Hello Alexandre,

Some time ago I wanted to contribute it
http://mail-archives.apache.org/mod_mbox/lucene-dev/201203.mbox/%3CCANGii8dUKAWp7MT1xQRjb5axdqPTM5r4z+YZpLFC7PTyWSqH1A@...%3E


On Mon, Jul 23, 2012 at 7:05 PM, Alexandre Rafalovitch
<[hidden email]>wrote:

> Hello,
>
> I have a multivalued field and I want to find records that have (for
> example) at least 3 values in that list. Is there an easy way to do
> it?
>
> Regards,
>    Alex.
> Personal blog: http://blog.outerthoughts.com/
> LinkedIn: http://www.linkedin.com/in/alexandrerafalovitch
> - Time is the quality of nature that keeps events from happening all
> at once. Lately, it doesn't seem to be working.  (Anonymous  - via GTD
> book)
>



--
Sincerely yours
Mikhail Khludnev
Tech Lead
Grid Dynamics

<http://www.griddynamics.com>
 <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Query for records that have more than N values in a multi-valued field

Chris Hostetter-3
In reply to this post by Alexandre Rafalovitch

: I have a multivalued field and I want to find records that have (for
: example) at least 3 values in that list. Is there an easy way to do
: it?

Typically this is solved by adding another field that contains the count
-- I thought i had already written an update processor in Solr 4.0.0-ALPHA
that would do this, but aparently i didn't, so i'll add one in SOLR-3670


-Hoss