You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@solr.apache.org by Netta STEINBERG <NS...@dalet.com> on 2021/08/12 07:17:03 UTC

Unexpected results while performing a full text search with an asterisk

Hi all,

I get unexpected results while performing a full text search with Solr 
7.5:
I get more results when I perform a full text search without an asterisk 
than when I search with an asterisk.
When the query is RESTAURANTE, I get 61 results


When the query is RESTAURANTE*, I get only 9 results


The only difference between the searches is the added asterisk.

Anyone has an idea for why this may happen? why a search with an asterisk 
yields less results than a search without the asterisk?

Thanks,
Netta Steinberg 

Re: Unexpected results while performing a full text search with an asterisk

Posted by Charlie Hull <ch...@opensourceconnections.com>.
Hi,

A couple of ideas to find out:
- Use the Solr admin panel to see how your query analysis chain handles 
both queries, and how RESTAURANTE is analyzed before indexing. Maybe the 
asterisk is preventing some analysis, thus making the query match fewer 
results?
- Use www.Splainer.io to see where matches happen and why

Cheers

Charlie

On 12/08/2021 08:17, Netta STEINBERG wrote:
> Hi all,
>
> I get unexpected results while performing a full text search with Solr 
> 7.5:
> I get more results when I perform a full text search without an 
> asterisk than when I search with an asterisk.
> When the query is RESTAURANTE, I get 61 results
>
>
> When the query is RESTAURANTE*, I get only 9 results
>
>
> The only difference between the searches is the added asterisk.
>
> Anyone has an idea for why this may happen? why a search with an 
> asterisk yields less results than a search without the asterisk?
>
> Thanks,
> Netta Steinberg


-- 
Charlie Hull - Managing Consultant at OpenSource Connections Limited 
<www.o19s.com>
Founding member of The Search Network <https://thesearchnetwork.com/> 
and co-author of Searching the Enterprise 
<https://opensourceconnections.com/about-us/books-resources/>
tel/fax: +44 (0)8700 118334
mobile: +44 (0)7767 825828

OpenSource Connections Europe GmbH | Pappelallee 78/79 | 10437 Berlin
Amtsgericht Charlottenburg | HRB 230712 B
Geschäftsführer: John M. Woodell | David E. Pugh
Finanzamt: Berlin Finanzamt für Körperschaften II

Re: Unexpected results while performing a full text search with an asterisk

Posted by matthew sporleder <ms...@gmail.com>.
RequestHander -> defaults -> df

On Sun, Aug 15, 2021 at 6:33 AM Netta Steinberg
<ne...@gmail.com> wrote:
>
> Thanks Stephen, I didn't know that there is no language analysis when using an asterisk.
> There are two things (somewhat related) that bother me:
> 1. as far as I know, the query parameter we send to SolR contains only the query string, without a specific field to search for, so I'm not sure which field(s) is(are) used during the parsing of the query (with or without the asterisk).
> 2. how can I use a separate field that doesn't do any stemming when I don't know how the query string is processed, since I don't send a specific field in the query parameter?
>
> Currently, I don't have the exact URL we use for the search. When I'll have it, I will know more, and update this thread (with the solution, hopefully.
>
> Thanks again.

Re: Unexpected results while performing a full text search with an asterisk

Posted by Netta Steinberg <ne...@gmail.com>.
Thanks Stephen, I didn't know that there is no language analysis when using an asterisk.
There are two things (somewhat related) that bother me:
1. as far as I know, the query parameter we send to SolR contains only the query string, without a specific field to search for, so I'm not sure which field(s) is(are) used during the parsing of the query (with or without the asterisk).
2. how can I use a separate field that doesn't do any stemming when I don't know how the query string is processed, since I don't send a specific field in the query parameter?

Currently, I don't have the exact URL we use for the search. When I'll have it, I will know more, and update this thread (with the solution, hopefully.

Thanks again.

Re: Unexpected results while performing a full text search with an asterisk

Posted by David Smiley <ds...@apache.org>.
Stephen is spot on.

Charlie: As nice as Solr's analysis screen is, it doesn't interpret any
query syntax and so won't show you the multiterm analysis chain results.
The UI ought to clarify this.

~ David Smiley
Apache Lucene/Solr Search Developer
http://www.linkedin.com/in/davidwsmiley


On Thu, Aug 12, 2021 at 8:28 AM Stephen Lewis Bianamara <
stephen.bianamara@gmail.com> wrote:

> Assuming this is a field with language analysis -- the search with an
> asterisk skips the language analysis portion and tries to match the string
> against the token. So if in some of your fields the tokenized and stemmed
> version of restaurante didn't have the e at the end I would expect those
> results to be missing. You probably need a separate field for substring
> search (search with wildcard) which doesn't do any stemming.
>
> On Thu, Aug 12, 2021, 12:17 AM Netta STEINBERG <NS...@dalet.com>
> wrote:
>
> > Hi all,
> >
> > I get unexpected results while performing a full text search with Solr
> 7.5:
> > I get more results when I perform a full text search without an asterisk
> > than when I search with an asterisk.
> > When the query is RESTAURANTE, I get 61 results
> >
> >
> > When the query is RESTAURANTE*, I get only 9 results
> >
> >
> > The only difference between the searches is the added asterisk.
> >
> > Anyone has an idea for why this may happen? why a search with an asterisk
> > yields less results than a search without the asterisk?
> >
> > Thanks,
> > Netta Steinberg
>

Re: Unexpected results while performing a full text search with an asterisk

Posted by Stephen Lewis Bianamara <st...@gmail.com>.
Assuming this is a field with language analysis -- the search with an
asterisk skips the language analysis portion and tries to match the string
against the token. So if in some of your fields the tokenized and stemmed
version of restaurante didn't have the e at the end I would expect those
results to be missing. You probably need a separate field for substring
search (search with wildcard) which doesn't do any stemming.

On Thu, Aug 12, 2021, 12:17 AM Netta STEINBERG <NS...@dalet.com> wrote:

> Hi all,
>
> I get unexpected results while performing a full text search with Solr 7.5:
> I get more results when I perform a full text search without an asterisk
> than when I search with an asterisk.
> When the query is RESTAURANTE, I get 61 results
>
>
> When the query is RESTAURANTE*, I get only 9 results
>
>
> The only difference between the searches is the added asterisk.
>
> Anyone has an idea for why this may happen? why a search with an asterisk
> yields less results than a search without the asterisk?
>
> Thanks,
> Netta Steinberg