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: Perfect Match
Date Tue, 23 Mar 2010 14:24:52 GMT
What Ahmet was getting to was that you need parentheses to insure that
all your terms go against the artist_s field. Something like
artist_s:(Dora The Explorer). But watch capitalization.

Adding debugQuery=on to your query will show you a lot about what's going
on.

HTH
Erick

On Tue, Mar 23, 2010 at 9:59 AM, Nair, Manas <Manas.Nair@mtvnmix.com> wrote:

> Thankyou Ahmet. You were right. artist_s:Dora is bringing results.
> But I need artist_s:Dora the explorer to bring only those results which
> contain "Dora the explorer".
>
> I tried to give artist_s:"Dora the explorer" (phrase search).. that is
> working. But artist_s:Dora the explorer is not working. Any way to make this
> artist_s:Dora the explorer to return results that contain this in them.
>
> Thanks.
>
> ________________________________
>
> From: Ahmet Arslan [mailto:iorixxx@yahoo.com]
> Sent: Tue 3/23/2010 9:32 AM
> To: solr-user@lucene.apache.org
> Subject: Re: Perfect Match
>
>
>
>
> > I need help on one of my issues with perfect matching of
> > terms.
> >
> > I have a collection of artists which are stored in the
> > index against the field name artist_t which is a text type
> > field. This field consists of values like ["dora", Dora The
> > Explorer", "Princess Dora The explorer"] across various docs
> > as in
> >
> > <doc>
> > <field name="artist_t">Dora</field>
> > </doc>
> > <doc>
> > <field name="artist_t">Dora The
> > Explorer</field>
> > </doc>
> > <doc>
> > <field name="artist_t">Princess Dora The
> > Explorer</field>
> > </doc>
> >
> > I am searching specifically on artist_t like
> > q=artist_t:Dora.
> > What I need is the one document which matches exactly with
> > Dora, ie. the first doc. "Dora the Explorer" and "Princess
> > Dora The Explorer" should not come along with it.
> >
> > But I am getting all the above.
> >
> > To tackle this problem, I tried to copyfield this artist_t
> > to a new field called artist_s which is of type string and
> > indexed the content again. But this approach also doesnt
> > help.
>
> with type="string" &q=artist_s:Dora should return only
> <doc>
> <field name="artist_s">Dora</field>
> </doc>
>
> > I tried to create a new field type with Keyword Tokenizer.
> > and tried to create a field of that type and copied artist_t
> > to this field. That also doesnt work.
>
> May be you have trailing white-spaces in your artists? Can you try with
> adding TrimFilterFactory after KeywordTokenizerFactory?
>
> > Is there any way of doing this??
> >
> > I need exact match ie. if I search for artist_t:Dora The
> > Explorer, I should get only the second doc and not the third
> > one(Princess Dora The Explorer).
>
> Note that q=artist_t:Dora The Explorer is parsed into artist_t:Dora
> defaultField:The defaultField:Explorer
>
> Can you do your tests with &q=artist_s:Dora?
>
>
>
>
>
>

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