You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Jami Kapla <jk...@quimbik.com> on 2007/08/09 22:08:41 UTC

Help Regarding Fuzzy Scoring

Hello,

I have been using Lucene recently (newbie) and reading about scoring.
However, have a result that of course still does not make sense to me.

I have an index created from a single field (entree) in one table in  
my DB.
I Index it with the StandardAnalyzer.

I also Query it with the StandardAnalyzer as simple as possible like:

             QueryParser qp = new QueryParser("title", new  
StandardAnalyzer());
             org.apache.lucene.search.Query query = qp.parse( qStr );
             hits = searcher.search( query );

Here is the possible responses that I know are in the index.

Chicken
Lemon chicken
Chicken parmesan
Chicken marsala
Chicken cordon blue
Chicken and dumplings
chickpeas
Bbq chicken
Garlic chicken
Teriyaki chicken
Chlcken picatta


If qStr="Chicken" thus basic TermQuery it works as expected and  
returns the result:

Chicken  			score=0.99999994   (sort of thought this would be 1.0 but  
at least it found and scored the right one)
Lemon chicken 		score=0.625Chicken parmesan	score=0.625
.... so on


However, if I make it a Fuzzy search by setting qStr="Chicken~" the  
results I get are

Chlcken picatta		score=1.0
Chicken 			score=0.4026232
Lemon chicken		score=0.2516395
Chicken parmesan	score=0.2516395
....so on

Most likely this is a lack of my understanding of the fundamentals  
but I would think
it should come up with Chicken as the highest score still considering  
it is an exact match.

Any clue as to why this is is greatly appreciated.

Meanwhile I am still reading docs and searching the web.

-Jami


Re: Help Regarding Fuzzy Scoring

Posted by Grant Ingersoll <gs...@apache.org>.
Try using the explain() method to give more insight.


On Aug 9, 2007, at 4:08 PM, Jami Kapla wrote:

> Hello,
>
> I have been using Lucene recently (newbie) and reading about scoring.
> However, have a result that of course still does not make sense to me.
>
> I have an index created from a single field (entree) in one table  
> in my DB.
> I Index it with the StandardAnalyzer.
>
> I also Query it with the StandardAnalyzer as simple as possible like:
>
>             QueryParser qp = new QueryParser("title", new  
> StandardAnalyzer());
>             org.apache.lucene.search.Query query = qp.parse( qStr );
>             hits = searcher.search( query );
>
> Here is the possible responses that I know are in the index.
>
> Chicken
> Lemon chicken
> Chicken parmesan
> Chicken marsala
> Chicken cordon blue
> Chicken and dumplings
> chickpeas
> Bbq chicken
> Garlic chicken
> Teriyaki chicken
> Chlcken picatta
>
>
> If qStr="Chicken" thus basic TermQuery it works as expected and  
> returns the result:
>
> Chicken  			score=0.99999994   (sort of thought this would be 1.0  
> but at least it found and scored the right one)
> Lemon chicken 		score=0.625Chicken parmesan	score=0.625
> .... so on
>
>
> However, if I make it a Fuzzy search by setting qStr="Chicken~" the  
> results I get are
>
> Chlcken picatta		score=1.0
> Chicken 			score=0.4026232
> Lemon chicken		score=0.2516395
> Chicken parmesan	score=0.2516395
> ....so on
>
> Most likely this is a lack of my understanding of the fundamentals  
> but I would think
> it should come up with Chicken as the highest score still  
> considering it is an exact match.
>
> Any clue as to why this is is greatly appreciated.
>
> Meanwhile I am still reading docs and searching the web.
>
> -Jami
>

--------------------------
Grant Ingersoll
http://lucene.grantingersoll.com

Lucene Helpful Hints:
http://wiki.apache.org/lucene-java/BasicsOfPerformance
http://wiki.apache.org/lucene-java/LuceneFAQ



---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org