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 "M.Rizwan" <gr...@gmail.com> on 2010/11/13 06:12:33 UTC

Searching problem

Hi All,

Do you have any idea that why solr search for "panasonic*" ( without
quotes ) does not match "panasonic" ?
If we search "panasonic" it matches a result but if we search with
"panasonic*" it does not find it.

What needs to be done here ?

Thanks

Riz

Re: Searching problem

Posted by Govind Kanshi <go...@gmail.com>.
You must spend time on -
http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters




On Sat, Nov 13, 2010 at 10:42 AM, M.Rizwan <gr...@gmail.com> wrote:

> Hi All,
>
> Do you have any idea that why solr search for "panasonic*" ( without
> quotes ) does not match "panasonic" ?
> If we search "panasonic" it matches a result but if we search with
> "panasonic*" it does not find it.
>
> What needs to be done here ?
>
> Thanks
>
> Riz
>

RE: Searching problem

Posted by Steven A Rowe <sa...@syr.edu>.
Hi Riz,

You likely have some form of stemming in your indexing analysis chain - this may cause "panasonic", e.g., to be indexed as "panason".  (The remainder of this email assumes that this is true.)

When you search for "panasonic", presumably with the same stemming filter in your query analysis chain, "panasonic" is transformed to "panason", and there will be a match.

However, prefix queries do not invoke any analysis, so your prefix query "panasonic*" will search for any term beginning with "panasonic", but since all "panasonic" terms have been indexed as "panason", there will be no match.

How to fix it?  Well, is stemming important?  If not, simply turning it off would fix the prefix query issue. 

In response to someone with similar issues, Mark Miller wrote <http://www.lucidimagination.com/search/document/a9de1bb7ab3f25f/query_with_stemming_prefix_and_fuzzy#e6d177dd8e076cf1>:

> Truncation queries and stemming are difficult partners. You likely have 
> to accept compromise. You can try using multiple fields like you are, 
> you can try indexing the full term at the same position as the stemmed 
> term, or you can accept the weirdness that comes from matching on a 
> stemmed form (potentially very confusing for a user).

Steve

> -----Original Message-----
> From: M.Rizwan [mailto:grizwan@gmail.com]
> Sent: Saturday, November 13, 2010 12:13 AM
> To: solr-user@lucene.apache.org
> Subject: Searching problem
> 
> Hi All,
> 
> Do you have any idea that why solr search for "panasonic*" ( without
> quotes ) does not match "panasonic" ?
> If we search "panasonic" it matches a result but if we search with
> "panasonic*" it does not find it.
> 
> What needs to be done here ?
> 
> Thanks
> 
> Riz