Yep, what you describe is what I do in similar situations, it works fine. It is certainly possible to facet on a tokenized field... but your individual facet values will be the _tokens_, not the complete values. And they'll be the post-analyzed tokens at that. Which is rarely what you want. Thus the use of two fields, one tokenized and analyzed, one not tokenized and minimimally analzyed (for instance, not stemmed). ________________________________________ From: elisabeth benoit [elisaelisael...@gmail.com] Sent: Thursday, April 28, 2011 9:03 AM To: solr-user@lucene.apache.org Subject: Re: fq parameter with partial value
yes, the multivalued field is not broken up into tokens. so, if I understand well what you mean, I could have a field CATEGORY with multiValued="true" a field CATEGORY_TOKENIZED with multiValued=" true" and then some POI <field name="NAME">POI_Name</field> ... <field name="*CATEGORY*">Restaurant Hotel</field> <field name="CATEGORY_TOKENIZED">Restaurant</field> <field name="CATEGORY_TOKENIZED">Hotel</field> do faceting on CATEGORY and fq on CATEGORY_TOKENIZED. But then, wouldn't it be possible to do faceting on CATEGORY_TOKENIZED? Best regards Elisabeth 2011/4/28 Erick Erickson <erickerick...@gmail.com> > So, I assume your CATEGORY field is multiValued but each value is not > broken up into tokens, right? If that's the case, would it work to have a > second field CATEGORY_TOKENIZED and run your fq against that > field instead? > > You could have this be a multiValued field with an increment gap if you > wanted > to prevent matches across separate entries and have your fq do a proximity > search where the proximity was less than the increment gap.... > > Best > Erick > > On Thu, Apr 28, 2011 at 6:03 AM, elisabeth benoit > <elisaelisael...@gmail.com> wrote: > > Hi Stefan, > > > > Thanks for answering. > > > > In more details, my problem is the following. I'm working on searching > > points of interest (POIs), which can be hotels, restaurants, plumbers, > > psychologists, etc. > > > > Those POIs can be identified among other things by categories or by > brand. > > And a single POIs might have different categories (no maximum number). > User > > might enter a query like > > > > > > McDonald’s Paris > > > > > > or > > > > > > Restaurant Paris > > > > > > or > > > > > > many other possible queries > > > > > > First I want to do a facet search on brand and categories, to find out > which > > case is the current case. > > > > > > http://localhost:8080/solr /select?q=restaurant paris > > &facet=true&facet.field=BRAND& facet.field=CATEGORY > > > > and get an answer like > > > > <lst name="facet_fields"> > > > > <lst name="CATEGORY"> > > > > <int name="Restaurant">598</int> > > > > <int name="Restaurant Hotel">451</int> > > > > > > > > Then I want to send a request with fq= CATEGORY: Restaurant and still get > > answers with CATEGORY= Restaurant Hotel. > > > > > > > > One solution would be to modify the data to add a new document every time > we > > have a new category, so a POI with three different categories would be > index > > three times, each time with a different category. > > > > > > But I was wondering if there was another way around. > > > > > > > > Thanks again, > > > > Elisabeth > > > > > > 2011/4/28 Stefan Matheis <matheis.ste...@googlemail.com> > > > >> Hi Elisabeth, > >> > >> that's not what FilterQueries are made for :) What against using that > >> Criteria in the Query? > >> Perhaps you want to describe your UseCase and we'll see if there's > >> another way to solve it? > >> > >> Regards > >> Stefan > >> > >> On Thu, Apr 28, 2011 at 9:09 AM, elisabeth benoit > >> <elisaelisael...@gmail.com> wrote: > >> > Hello, > >> > > >> > I would like to know if there is a way to use the fq parameter with a > >> > partial value. > >> > > >> > For instance, if I have a request with fq=NAME:Joe, and I would like > to > >> > retrieve all answers where NAME contains Joe, including those with > NAME = > >> > Joe Smith. > >> > > >> > Thanks, > >> > Elisabeth > >> > > >> > > >