lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <erickerick...@gmail.com>
Subject Re: MultiValued Search using Filter Query
Date Fri, 01 Mar 2013 01:27:56 GMT
Well, first are you using that syntax? Because it's not correct.
q=sym:TEST
fq=initials:MKN

[] is the "range" operator.

Second, you are using a "string" type for initials, which isn't analyzed in
any way so you'd have to search on exactly MKN JRT. MKN wouldn't match. JRT
wouldn't match. MKN  JRT (two spaces between) wouldn't match.

The admin/analysis page shows you exactly how data sent to fields is
parsed, it's invaluable. Also, adding &debug=all to the query will show you
how the query gets parsed, which often gives you a clue, although it does
take some practice to know which parts of the output are relevant....

Best
Erick


On Wed, Feb 27, 2013 at 10:12 PM, Deepak <deepak.parmar@gmail.com> wrote:

> Hi
>
> How can I filter records using filter query on multiValued field.  Here are
> two records
>
>       {
>         "sub_count":8,
>         "long_name":"Mike",
>         "first_name":"John",
>         "id":45949,
>         "sym":"TEST",
>         "type":"T",
>         "last_name":"Account",
>         "person_id":"3613",
>         "short_name":"Molly",
>         "initials":["ABC XYZ"],
>         "timestamp":"2013-02-28T02:44:02.235Z"
>     }
>
>       {
>         "sub_count":8,
>         "long_name":"Mike",
>         "first_name":"John",
>         "id":45949,
>         "sym":"TEST",
>         "type":"T",
>         "last_name":"Account",
>         "person_id":"3613",
>         "short_name":"Molly",
>         "initials":["MKN JRT"],
>         "timestamp":"2013-02-28T02:44:02.235Z"
>     }
>
> <field name="initials"  type="string" indexed="true" stored="true"
> multiValued="true" />
>
> <field column="initials"       name ="initials"  splitBy=" "     />
>
>
> Note. All values are same except initials field value.
> My search criteria
> q:sym:TEST
> fq:initials[MKN]
>
> This doesn't return the second record.  What am I missing here?
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/MultiValued-Search-using-Filter-Query-tp4043544.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

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