You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Alessandro Senserini <al...@plateau.com> on 2008/01/31 00:31:53 UTC

wildcard newbie question

I have a text field type called courseTitle and it contains 

 

Struts 2

 

If I search courseTitle:strut*  I get the documents but if I search with
courseTitle:struts* I do not get any results.

Could you please explain why?

 

Thanks.


.
The information contained in this e-mail message is intended only for the personal 
and confidential use of the recipient(s) named above. This message is privileged 
and confidential. If the reader of this message is not the intended recipient or an
agent responsible for delivering it to the intended recipient, you are hereby notified 
that you have received this document in error and that any review, dissemination, 
distribution, or copying of this message is strictly prohibited.


RE: wildcard newbie question

Posted by Ard Schrijvers <a....@hippo.nl>.
> > I have a text field type called courseTitle and it contains
> > 
> > Struts 2
> > 
> > If I search courseTitle:strut*  I get the documents but if I search 
> > with
> > courseTitle:struts* I do not get any results.
> > 
> > Could you please explain why?
> 
> Just a guess: It might be because of stemming. Do you have 
> the same effect with words that don't end in an 's' or similar?
> If my guess is correct, only 'strut' is in the index, not 'struts'.

I have seen this behavior quite often before indeed. I understand why it
does not give a hit because of stemming, but in the end, it seems a
little wrong to me. 'stemm*' should match 'stemmed' basically.
Obviously, using an analyzer without stemming solves the problem, but
then again you do not have stemming

-Ard

> 
> -Michael
> 
> 

Re: wildcard newbie question

Posted by Michael Lackhoff <mi...@lackhoff.de>.
On 31.01.2008 00:31 Alessandro Senserini wrote:

> I have a text field type called courseTitle and it contains 
> 
> Struts 2
> 
> If I search courseTitle:strut*  I get the documents but if I search with
> courseTitle:struts* I do not get any results.
> 
> Could you please explain why?

Just a guess: It might be because of stemming. Do you have the same 
effect with words that don't end in an 's' or similar?
If my guess is correct, only 'strut' is in the index, not 'struts'.

-Michael


Re: wildcard newbie question

Posted by Mike Klaas <mi...@gmail.com>.
On 30-Jan-08, at 3:31 PM, Alessandro Senserini wrote:

> I have a text field type called courseTitle and it contains
>
>
>
> Struts 2
>
>
>
> If I search courseTitle:strut*  I get the documents but if I search  
> with
> courseTitle:struts* I do not get any results.
>
> Could you please explain why?

Wildcard queries are not analyzed (see <http://wiki.apache.org/lucene- 
java/LuceneFAQ#head-133cf44dd3dff3680c96c1316a663e881eeac35a>).  In  
your case, turning off stemming for the field should fix the problem.

-Mike

Re: wildcard newbie question

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
My hunch is that your courseTitle field is being stemmed.  What type  
is it and what is the definition of that type?

"Struts" indexed with stemming would be "strut", thus no "struts*"  
words exist in the index.  It's a tricky situation to deal with  
wildcards with such indexing analysis.

	Erik


On Jan 30, 2008, at 6:31 PM, Alessandro Senserini wrote:

> I have a text field type called courseTitle and it contains
>
>
>
> Struts 2
>
>
>
> If I search courseTitle:strut*  I get the documents but if I search  
> with
> courseTitle:struts* I do not get any results.
>
> Could you please explain why?
>
>
>
> Thanks.
>
>
> .
> The information contained in this e-mail message is intended only  
> for the personal
> and confidential use of the recipient(s) named above. This message  
> is privileged
> and confidential. If the reader of this message is not the intended  
> recipient or an
> agent responsible for delivering it to the intended recipient, you  
> are hereby notified
> that you have received this document in error and that any review,  
> dissemination,
> distribution, or copying of this message is strictly prohibited.
>