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 Szűcs Roland <sz...@bookandwalk.hu> on 2015/07/31 11:07:08 UTC
multiple but identical suggestions in autocomplete
Hello Guys,
I use SOLR 5.2.1 and the relatively new solr.SuggestComponent. It worked
fine at the beginning. I use this function to auto-complete the publisher
names. I have 3000 documents and 80 publishers. When I use the autocomplete
feature and I get back the name of the publishers matched as many times as
many book titles they published.
If suggest.q=Har and Harlequin publisher has 100 documents I get back a
json with 100 suggestions with the same publisher name. Obviously it is not
my intention. I would like to get back the matched publisher name once and
later I will use a filter query to the selected publisher name.
Any Idea how can I get identical suggestions only once? Is there any
parameter I can set in solrconfig.xml to solve this?
Thanks in advance,
--
<https://www.linkedin.com/pub/roland-sz%C5%B1cs/28/226/24/hu>Szűcs Roland
<https://www.linkedin.com/pub/roland-sz%C5%B1cs/28/226/24/hu>Ismerkedjünk
meg a Linkedin <https://www.linkedin.com/pub/roland-sz%C5%B1cs/28/226/24/hu>
-en <https://bookandwalk.hu/>ÜgyvezetőTelefon: +36 1 210 81 13Bookandwalk.hu
<https://bokandwalk.hu/>
Re: multiple but identical suggestions in autocomplete
Posted by Alessandro Benedetti <ab...@apache.org>.
Related this, I just created this :
https://issues.apache.org/jira/browse/SOLR-8672
To be fair, I see no utility in returning duplicate suggestions ( if they
have no different payload, they are un-distinguishable from a human
perspective hence useless to have duplication) .
I would like to hear some counter example.
In my opinion we should contribute a way to avoid the duplicates directly
in Solr.
If there are valid counter examples, we could add an additional parameter
for the solr.SuggestComponent like <allowDuplicates> boolean
<allowDuplicates> .
In a lot of scenarios I guess it could be a good fit.
Cheers
On 5 August 2015 at 12:06, Nutch Solr User <nu...@gmail.com> wrote:
> You will need to call this service from UI as you are calling suggester
> component currently. (may be on every key-press event in text box). You
> will
> pass required parameters too.
>
> Service will internally form a solr suggester query and query Solr. From
> the
> returned response it will keep only unique suggestions from top N
> suggestions and return suggestions to UI.
>
>
>
> -----
> Nutch Solr User
>
> "The ultimate search engine would basically understand everything in the
> world, and it would always give you the right thing."
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/multiple-but-identical-suggestions-in-autocomplete-tp4220055p4220953.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
--
--------------------------
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: multiple but identical suggestions in autocomplete
Posted by Nutch Solr User <nu...@gmail.com>.
You will need to call this service from UI as you are calling suggester
component currently. (may be on every key-press event in text box). You will
pass required parameters too.
Service will internally form a solr suggester query and query Solr. From the
returned response it will keep only unique suggestions from top N
suggestions and return suggestions to UI.
-----
Nutch Solr User
"The ultimate search engine would basically understand everything in the world, and it would always give you the right thing."
--
View this message in context: http://lucene.472066.n3.nabble.com/multiple-but-identical-suggestions-in-autocomplete-tp4220055p4220953.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: multiple but identical suggestions in autocomplete
Posted by Szűcs Roland <sz...@bookandwalk.hu>.
Hello Nutch Solr user,
You are right I use DocumentDictionaryFactory as you can see in my
solrconfig file
<searchComponent name="suggest" class="solr.SuggestComponent">
<lst name="suggester">
<str name="name">suggest_publisher</str>
<str name="lookupImpl">AnalyzingInfixLookupFactory</str>
<str name="dictionaryImpl">DocumentDictionaryFactory</str>
<str name="field">publisher</str>
<str name="suggestAnalyzerFieldType">text_hu_suggest_ngram</str>
<str name="indexPath">suggester_infix_dir_publisher</str>
<str name="weightField">price</str>
<str name="builOnStartup">false</str>
<str name="buildOnCommit">false</str>
</lst>
</searchComponent>
You wrote that you you have developed a service between the ui and solr.
How can I use that one if I use javascript / ajax on the client side?
Thanks,
Roland
2015-08-04 16:25 GMT+02:00 Nutch Solr User <nu...@gmail.com>:
> May be you are using DocumentDictionaryFactory because
> HighFrequencyDictionaryFactory will never return duplicate duplicate terms.
>
> We also had same problem with *DocumentDictionaryFactory +
> AnalyzingInfixSuggester* We have created one service between UI and Solr
> which groups duplicate suggestions. and returns unique list to UI with only
> contains unique suggestions.
>
>
>
> -----
> Nutch Solr User
>
> "The ultimate search engine would basically understand everything in the
> world, and it would always give you the right thing."
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/multiple-but-identical-suggestions-in-autocomplete-tp4220055p4220727.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
--
<https://www.linkedin.com/pub/roland-sz%C5%B1cs/28/226/24/hu>Szűcs Roland
<https://www.linkedin.com/pub/roland-sz%C5%B1cs/28/226/24/hu>Ismerkedjünk
meg a Linkedin <https://www.linkedin.com/pub/roland-sz%C5%B1cs/28/226/24/hu>
-en <https://bookandwalk.hu/>ÜgyvezetőTelefon: +36 1 210 81 13Bookandwalk.hu
<https://bokandwalk.hu/>
Re: multiple but identical suggestions in autocomplete
Posted by Nutch Solr User <nu...@gmail.com>.
May be you are using DocumentDictionaryFactory because
HighFrequencyDictionaryFactory will never return duplicate duplicate terms.
We also had same problem with *DocumentDictionaryFactory +
AnalyzingInfixSuggester* We have created one service between UI and Solr
which groups duplicate suggestions. and returns unique list to UI with only
contains unique suggestions.
-----
Nutch Solr User
"The ultimate search engine would basically understand everything in the world, and it would always give you the right thing."
--
View this message in context: http://lucene.472066.n3.nabble.com/multiple-but-identical-suggestions-in-autocomplete-tp4220055p4220727.html
Sent from the Solr - User mailing list archive at Nabble.com.