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 Manohar Sripada <ma...@gmail.com> on 2016/03/15 09:19:53 UTC
Issue with Auto Suggester Component
Consider the below company names indexed. I want the below auto suggestions
to be listed when searched for "abc". Basically, I want prefix search of
entire keyword to be of high preference (#1 to #5 in the below example)
followed by prefix part of any other string (the last 2 in the below
example). I am not bothered about ordering within 1st and 2nd set.
ABC Corporation
ABCD Corporation
Abc Tech
AbCorporation
ABCD company
The ABC Company
The ABCDEF
I am using Suggest feature of solr as mentioned in the wiki
<https://cwiki.apache.org/confluence/display/solr/Suggester>. I used
different Lookup implementations available, but, I couldn't get the result
as above. Here's is one sample config I used with BlendedInfixLookupFactory
*<lst name="suggester">*
* <str name="name">businessNameBlendedInfixSuggester1</str>*
* <str name="lookupImpl">BlendedInfixLookupFactory</str>*
* <str name="dictionaryImpl">DocumentDictionaryFactory</str>*
* <str name="field">business_name_suggest</str>*
* <str name="payloadField">id</str>*
*<str name="suggestAnalyzerFieldType">text_suggest</str>*
* <str name="sortField">business_name</str>*
* <str name="blenderType">linear</str>*
* <str name="exactMatchFirst">true</str>*
* <str name="indexPath">/app/solrnode/suggest_test_1_blendedinfix1</str>*
* <str name="minPrefixChars">0</str>*
* <str name="buildOnCommit">true</str>*
* <str name="buildOnOptimize">true</str>*
* <str name="highlight">false</str>*
* </lst>*
Can someone please suggest on how I can achieve this?
Thanks,
Manohar
Re: Issue with Auto Suggester Component
Posted by Alessandro Benedetti <ab...@apache.org>.
Let's try to keep it simple , please provide a query and the expected
ranking of the results.
I find quite difficult to read and intepret in this way :)
Then we can sort a proper autocomplete out :)
Cheers
On Wed, Mar 16, 2016 at 10:52 AM, Manohar Sripada <ma...@gmail.com>
wrote:
> Thanks for the response.
> If you see the first 5 results- "*ABC* Corporation", "*ABC*D
> Corporation", "*Abc
> *Tech", "*AbC*orporation", "*ABC*D company". The keyword "*abc*" that I am
> trying to search is part of prefix of all the strings. Sorry, it's not
> entire keyword to be of higher importance like #1, #3 and #6.
> In the 2nd set of results, "The *ABC* Company", "The *ABC*DEF", the keyword
> "*abc*" is not part of prefix of 1st string, but it is part of some other
> string of each result.
>
> Thanks,
> Manohar
>
> On Tue, Mar 15, 2016 at 3:03 PM, Alessandro Benedetti <
> abenedetti@apache.org
> > wrote:
>
> > Hi Manohar,
> > I have not clear what should be your ideal ranking of suggestions.
> >
> > "I want prefix search of
> > entire keyword to be of high preference (#1 to #5 in the below example)
> > followed by prefix part of any other string (the last 2 in the below
> > example). I am not bothered about ordering within 1st and 2nd set.
> >
> > ABC Corporation
> > ABCD Corporation
> > Abc Tech
> > AbCorporation
> > ABCD company
> > The ABC Company
> > The ABCDEF"
> >
> > Could you take the example you posted, show an example of query and the
> > expected sort order ?
> > According to your description of the problem
> > Query : abc
> > 1 Criteria : entire keyword to be of high preference
> > I can't understand why you didn't count #3, #6 but you did #5 .
> >
> > 2 Criteria : followed by prefix part of any other string
> > It is not that clear, probably you mean all the rest.
> > Anyway an infix lookup algorithm with a boost for exact search should do
> > the trick.
> >
> > Please give us some more details !
> >
> > Cheers
> >
> > On Tue, Mar 15, 2016 at 8:19 AM, Manohar Sripada <ma...@gmail.com>
> > wrote:
> >
> > > Consider the below company names indexed. I want the below auto
> > suggestions
> > > to be listed when searched for "abc". Basically, I want prefix search
> of
> > > entire keyword to be of high preference (#1 to #5 in the below example)
> > > followed by prefix part of any other string (the last 2 in the below
> > > example). I am not bothered about ordering within 1st and 2nd set.
> > >
> > > ABC Corporation
> > > ABCD Corporation
> > > Abc Tech
> > > AbCorporation
> > > ABCD company
> > > The ABC Company
> > > The ABCDEF
> > >
> > > I am using Suggest feature of solr as mentioned in the wiki
> > > <https://cwiki.apache.org/confluence/display/solr/Suggester>. I used
> > > different Lookup implementations available, but, I couldn't get the
> > result
> > > as above. Here's is one sample config I used with
> > BlendedInfixLookupFactory
> > >
> > >
> > > *<lst name="suggester">*
> > > * <str name="name">businessNameBlendedInfixSuggester1</str>*
> > > * <str name="lookupImpl">BlendedInfixLookupFactory</str>*
> > > * <str name="dictionaryImpl">DocumentDictionaryFactory</str>*
> > > * <str name="field">business_name_suggest</str>*
> > > * <str name="payloadField">id</str>*
> > > *<str name="suggestAnalyzerFieldType">text_suggest</str>*
> > > * <str name="sortField">business_name</str>*
> > > * <str name="blenderType">linear</str>*
> > > * <str name="exactMatchFirst">true</str>*
> > > * <str
> name="indexPath">/app/solrnode/suggest_test_1_blendedinfix1</str>*
> > > * <str name="minPrefixChars">0</str>*
> > > * <str name="buildOnCommit">true</str>*
> > > * <str name="buildOnOptimize">true</str>*
> > > * <str name="highlight">false</str>*
> > > * </lst>*
> > >
> > > Can someone please suggest on how I can achieve this?
> > >
> > > Thanks,
> > > Manohar
> > >
> >
> >
> >
> > --
> > --------------------------
> >
> > Benedetti Alessandro
> > Visiting card : http://about.me/alessandro_benedetti
> >
> > "Tyger, tyger burning bright
> > In the forests of the night,
> > What immortal hand or eye
> > Could frame thy fearful symmetry?"
> >
> > William Blake - Songs of Experience -1794 England
> >
>
--
--------------------------
Benedetti Alessandro
Visiting card : http://about.me/alessandro_benedetti
"Tyger, tyger burning bright
In the forests of the night,
What immortal hand or eye
Could frame thy fearful symmetry?"
William Blake - Songs of Experience -1794 England
Re: Issue with Auto Suggester Component
Posted by Manohar Sripada <ma...@gmail.com>.
Thanks for the response.
If you see the first 5 results- "*ABC* Corporation", "*ABC*D
Corporation", "*Abc
*Tech", "*AbC*orporation", "*ABC*D company". The keyword "*abc*" that I am
trying to search is part of prefix of all the strings. Sorry, it's not
entire keyword to be of higher importance like #1, #3 and #6.
In the 2nd set of results, "The *ABC* Company", "The *ABC*DEF", the keyword
"*abc*" is not part of prefix of 1st string, but it is part of some other
string of each result.
Thanks,
Manohar
On Tue, Mar 15, 2016 at 3:03 PM, Alessandro Benedetti <abenedetti@apache.org
> wrote:
> Hi Manohar,
> I have not clear what should be your ideal ranking of suggestions.
>
> "I want prefix search of
> entire keyword to be of high preference (#1 to #5 in the below example)
> followed by prefix part of any other string (the last 2 in the below
> example). I am not bothered about ordering within 1st and 2nd set.
>
> ABC Corporation
> ABCD Corporation
> Abc Tech
> AbCorporation
> ABCD company
> The ABC Company
> The ABCDEF"
>
> Could you take the example you posted, show an example of query and the
> expected sort order ?
> According to your description of the problem
> Query : abc
> 1 Criteria : entire keyword to be of high preference
> I can't understand why you didn't count #3, #6 but you did #5 .
>
> 2 Criteria : followed by prefix part of any other string
> It is not that clear, probably you mean all the rest.
> Anyway an infix lookup algorithm with a boost for exact search should do
> the trick.
>
> Please give us some more details !
>
> Cheers
>
> On Tue, Mar 15, 2016 at 8:19 AM, Manohar Sripada <ma...@gmail.com>
> wrote:
>
> > Consider the below company names indexed. I want the below auto
> suggestions
> > to be listed when searched for "abc". Basically, I want prefix search of
> > entire keyword to be of high preference (#1 to #5 in the below example)
> > followed by prefix part of any other string (the last 2 in the below
> > example). I am not bothered about ordering within 1st and 2nd set.
> >
> > ABC Corporation
> > ABCD Corporation
> > Abc Tech
> > AbCorporation
> > ABCD company
> > The ABC Company
> > The ABCDEF
> >
> > I am using Suggest feature of solr as mentioned in the wiki
> > <https://cwiki.apache.org/confluence/display/solr/Suggester>. I used
> > different Lookup implementations available, but, I couldn't get the
> result
> > as above. Here's is one sample config I used with
> BlendedInfixLookupFactory
> >
> >
> > *<lst name="suggester">*
> > * <str name="name">businessNameBlendedInfixSuggester1</str>*
> > * <str name="lookupImpl">BlendedInfixLookupFactory</str>*
> > * <str name="dictionaryImpl">DocumentDictionaryFactory</str>*
> > * <str name="field">business_name_suggest</str>*
> > * <str name="payloadField">id</str>*
> > *<str name="suggestAnalyzerFieldType">text_suggest</str>*
> > * <str name="sortField">business_name</str>*
> > * <str name="blenderType">linear</str>*
> > * <str name="exactMatchFirst">true</str>*
> > * <str name="indexPath">/app/solrnode/suggest_test_1_blendedinfix1</str>*
> > * <str name="minPrefixChars">0</str>*
> > * <str name="buildOnCommit">true</str>*
> > * <str name="buildOnOptimize">true</str>*
> > * <str name="highlight">false</str>*
> > * </lst>*
> >
> > Can someone please suggest on how I can achieve this?
> >
> > Thanks,
> > Manohar
> >
>
>
>
> --
> --------------------------
>
> Benedetti Alessandro
> Visiting card : http://about.me/alessandro_benedetti
>
> "Tyger, tyger burning bright
> In the forests of the night,
> What immortal hand or eye
> Could frame thy fearful symmetry?"
>
> William Blake - Songs of Experience -1794 England
>
Re: Issue with Auto Suggester Component
Posted by Alessandro Benedetti <ab...@apache.org>.
Hi Manohar,
I have not clear what should be your ideal ranking of suggestions.
"I want prefix search of
entire keyword to be of high preference (#1 to #5 in the below example)
followed by prefix part of any other string (the last 2 in the below
example). I am not bothered about ordering within 1st and 2nd set.
ABC Corporation
ABCD Corporation
Abc Tech
AbCorporation
ABCD company
The ABC Company
The ABCDEF"
Could you take the example you posted, show an example of query and the
expected sort order ?
According to your description of the problem
Query : abc
1 Criteria : entire keyword to be of high preference
I can't understand why you didn't count #3, #6 but you did #5 .
2 Criteria : followed by prefix part of any other string
It is not that clear, probably you mean all the rest.
Anyway an infix lookup algorithm with a boost for exact search should do
the trick.
Please give us some more details !
Cheers
On Tue, Mar 15, 2016 at 8:19 AM, Manohar Sripada <ma...@gmail.com>
wrote:
> Consider the below company names indexed. I want the below auto suggestions
> to be listed when searched for "abc". Basically, I want prefix search of
> entire keyword to be of high preference (#1 to #5 in the below example)
> followed by prefix part of any other string (the last 2 in the below
> example). I am not bothered about ordering within 1st and 2nd set.
>
> ABC Corporation
> ABCD Corporation
> Abc Tech
> AbCorporation
> ABCD company
> The ABC Company
> The ABCDEF
>
> I am using Suggest feature of solr as mentioned in the wiki
> <https://cwiki.apache.org/confluence/display/solr/Suggester>. I used
> different Lookup implementations available, but, I couldn't get the result
> as above. Here's is one sample config I used with BlendedInfixLookupFactory
>
>
> *<lst name="suggester">*
> * <str name="name">businessNameBlendedInfixSuggester1</str>*
> * <str name="lookupImpl">BlendedInfixLookupFactory</str>*
> * <str name="dictionaryImpl">DocumentDictionaryFactory</str>*
> * <str name="field">business_name_suggest</str>*
> * <str name="payloadField">id</str>*
> *<str name="suggestAnalyzerFieldType">text_suggest</str>*
> * <str name="sortField">business_name</str>*
> * <str name="blenderType">linear</str>*
> * <str name="exactMatchFirst">true</str>*
> * <str name="indexPath">/app/solrnode/suggest_test_1_blendedinfix1</str>*
> * <str name="minPrefixChars">0</str>*
> * <str name="buildOnCommit">true</str>*
> * <str name="buildOnOptimize">true</str>*
> * <str name="highlight">false</str>*
> * </lst>*
>
> Can someone please suggest on how I can achieve this?
>
> Thanks,
> Manohar
>
--
--------------------------
Benedetti Alessandro
Visiting card : http://about.me/alessandro_benedetti
"Tyger, tyger burning bright
In the forests of the night,
What immortal hand or eye
Could frame thy fearful symmetry?"
William Blake - Songs of Experience -1794 England