wildcard newbie question

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

wildcard newbie question

Alessandro Senserini
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.
Reply | Threaded
Open this post in threaded view
|

Re: wildcard newbie question

Erik Hatcher
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.
>

Reply | Threaded
Open this post in threaded view
|

Re: wildcard newbie question

Michael Lackhoff-2
In reply to this post by Alessandro Senserini
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

Reply | Threaded
Open this post in threaded view
|

RE: wildcard newbie question

Ard Schrijvers
> > 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
>
>
Reply | Threaded
Open this post in threaded view
|

Re: wildcard newbie question

Mike Klaas
In reply to this post by Alessandro Senserini
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