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 Rounak Jain <ro...@gmail.com> on 2013/05/07 16:41:49 UTC

Get Suggester to return same phrase as query

Hi,

I'm using the Suggester component in Solr, and if I search for "iPhone 5"
the suggestions never give me the same phrase, that is "iPhone 5." Is there
any way to alter this behaviour to return "iPhone 5" as well?

A backup option could be to always display what the user has entered in the
UI, but I want it to be displayed *only *if there are results for it in
Solr, which is only possible if Solr returns the term.

Rounak

Re: Get Suggester to return same phrase as query

Posted by Rounak Jain <ro...@gmail.com>.
Thanks, Erick. The link you gave me is mostly about getting Suggester
working with Phrases, which I've already done with queryAnalyzerFieldType
and no custom code.

What my main issue is that the query itself isn't getting returned *if *it
is an actual word/token in my index. So for example if a user begins typing
in w, wo, wom and so on, I wouldn't like those to appear in the suggestion
list, but if he or she types "women", which is a legitimate word and very
likely appears frequently in my index, I'd like it to be returned in the
suggestion list.

I want to know if there's any way to configure Solr's Suggester to behave
this way apart from modifying the source.

Thanks,

Rounak


On Tue, May 7, 2013 at 11:48 PM, Erick Erickson <er...@gmail.com>wrote:

> Hmmm, R. Muir did some work here:
> https://issues.apache.org/jira/browse/SOLR-3143, note that it's 4.0 or
> later. I haven't implemented this, but this is a common problem so if
> you do dig into it and get it to work (warning, I haven't a clue) it'd
> be a great contribution to the Wiki.
>
> Best
> Erick
>
> On Tue, May 7, 2013 at 10:41 AM, Rounak Jain <ro...@gmail.com> wrote:
> > Hi,
> >
> > I'm using the Suggester component in Solr, and if I search for "iPhone 5"
> > the suggestions never give me the same phrase, that is "iPhone 5." Is
> there
> > any way to alter this behaviour to return "iPhone 5" as well?
> >
> > A backup option could be to always display what the user has entered in
> the
> > UI, but I want it to be displayed *only *if there are results for it in
> > Solr, which is only possible if Solr returns the term.
> >
> > Rounak
>

Re: Get Suggester to return same phrase as query

Posted by Erick Erickson <er...@gmail.com>.
Hmmm, R. Muir did some work here:
https://issues.apache.org/jira/browse/SOLR-3143, note that it's 4.0 or
later. I haven't implemented this, but this is a common problem so if
you do dig into it and get it to work (warning, I haven't a clue) it'd
be a great contribution to the Wiki.

Best
Erick

On Tue, May 7, 2013 at 10:41 AM, Rounak Jain <ro...@gmail.com> wrote:
> Hi,
>
> I'm using the Suggester component in Solr, and if I search for "iPhone 5"
> the suggestions never give me the same phrase, that is "iPhone 5." Is there
> any way to alter this behaviour to return "iPhone 5" as well?
>
> A backup option could be to always display what the user has entered in the
> UI, but I want it to be displayed *only *if there are results for it in
> Solr, which is only possible if Solr returns the term.
>
> Rounak