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 <elleryle...@be-o.com> wrote: > Hi all > > > > I am using Solr 3.4 on Windows 7. > > > > Here is the example of a multivalue field: > > > > <doc> > > <arr name="field_name"> > > <str>387</str> > > <str>386</str> > > </arr> > > </doc> > > > > <doc> > > <arr name=" field_name "> > > <str>387</str> > > <str>386</str> > > </arr> > > </doc> > > > > <doc> > > <arr name=" field_name"> > > <str>387</str> > > <str>386</str> > > <str>385</str> > > <str>382</str> > > <str>312</str> > > <str>311</str> > > </arr> > > </doc> > > > > 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. > >