RE: How to return exact set of multivalue field
: Follow up question: what if it is a string instead of number? While you can : use [387 TO *] to find out all number that is bigger than 387, how do you : find specific set of "string"? range queries should also work on strings, but i think the more general solution to your problem is that you should index an additional field that contains the total number of values in your multivalued field, and then use the count as a constraint as well... +field_name:(385 386) +field_name_count:2 -Hoss
RE: How to return exact set of multivalue field
Thank you very much for your help! Follow up question: what if it is a string instead of number? While you can use [387 TO *] to find out all number that is bigger than 387, how do you find specific set of "string"? Thank you again for any help here. -Original Message- From: dan sutton [mailto:danbsut...@gmail.com] Sent: 2011年10月20日 6:09 下午 To: solr-user@lucene.apache.org; elleryle...@be-o.com Subject: Re: How to return exact set of multivalue field -field_name:[ * TO 384] +field_name:[385 TO 386] -field_name:[387 TO *] On Thu, Oct 20, 2011 at 10:51 AM, Ellery Leung wrote: > Hi all > > > > I am using Solr 3.4 on Windows 7. > > > > Here is the example of a multivalue field: > > > > > > > > 387 > > 386 > > > > > > > > > > > > 387 > > 386 > > > > > > > > > > > > 387 > > 386 > > 385 > > 382 > > 312 > > 311 > > > > > > > > I am doing a search on "field_name" and JUST want to return record that IS > 387 and 386 (the first and second record). > > > > Here is the query: > > > > field_name: (387 AND 386) > > > > But this query return all 3 records, which is wrong. > > > > I have tried using filter: field_name: (387 AND 386) but it still doesn't > work. > > > > Therefore I would like to ask, are there any way to change this query so > that it will ONLY return first and second record? > > > > Thank you in advance for any help. > >
Re: How to return exact set of multivalue field
-field_name:[ * TO 384] +field_name:[385 TO 386] -field_name:[387 TO *] On Thu, Oct 20, 2011 at 10:51 AM, Ellery Leung wrote: > Hi all > > > > I am using Solr 3.4 on Windows 7. > > > > Here is the example of a multivalue field: > > > > > > > > 387 > > 386 > > > > > > > > > > > > 387 > > 386 > > > > > > > > > > > > 387 > > 386 > > 385 > > 382 > > 312 > > 311 > > > > > > > > I am doing a search on "field_name" and JUST want to return record that IS > 387 and 386 (the first and second record). > > > > Here is the query: > > > > field_name: (387 AND 386) > > > > But this query return all 3 records, which is wrong. > > > > I have tried using filter: field_name: (387 AND 386) but it still doesn't > work. > > > > Therefore I would like to ask, are there any way to change this query so > that it will ONLY return first and second record? > > > > Thank you in advance for any help. > >
How to return exact set of multivalue field
Hi all I am using Solr 3.4 on Windows 7. Here is the example of a multivalue field: 387 386 387 386 387 386 385 382 312 311 I am doing a search on "field_name" and JUST want to return record that IS 387 and 386 (the first and second record). Here is the query: field_name: (387 AND 386) But this query return all 3 records, which is wrong. I have tried using filter: field_name: (387 AND 386) but it still doesn't work. Therefore I would like to ask, are there any way to change this query so that it will ONLY return first and second record? Thank you in advance for any help.