You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Arcadius Ahouansou (JIRA)" <ji...@apache.org> on 2015/07/31 10:13:04 UTC

[jira] [Commented] (SOLR-6648) AnalyzingInfixLookupFactory always highlights suggestions

    [ https://issues.apache.org/jira/browse/SOLR-6648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14648905#comment-14648905 ] 

Arcadius Ahouansou commented on SOLR-6648:
------------------------------------------

Would be nice if highlight was a query-time parameter where clients could choose whether they want it or not.

> AnalyzingInfixLookupFactory always highlights suggestions
> ---------------------------------------------------------
>
>                 Key: SOLR-6648
>                 URL: https://issues.apache.org/jira/browse/SOLR-6648
>             Project: Solr
>          Issue Type: Sub-task
>    Affects Versions: 4.9, 4.9.1, 4.10, 4.10.1
>            Reporter: Varun Thacker
>            Assignee: Tomás Fernández Löbbe
>              Labels: suggester
>             Fix For: 5.1, Trunk
>
>         Attachments: SOLR-6648-v4.10.3.patch, SOLR-6648.patch
>
>
> When using AnalyzingInfixLookupFactory suggestions always return with the match term as highlighted and 'allTermsRequired' is always set to true.
> We should be able to configure those.
> Steps to reproduce - 
> schema additions
> {code}
> <searchComponent name="suggest" class="solr.SuggestComponent">
>     <lst name="suggester">
>       <str name="name">mySuggester</str>
>       <str name="lookupImpl">AnalyzingInfixLookupFactory</str>
>       <str name="dictionaryImpl">DocumentDictionaryFactory</str> 
>       <str name="field">suggestField</str>
>       <str name="weightField">weight</str>
>       <str name="suggestAnalyzerFieldType">textSuggest</str>
>     </lst>
>   </searchComponent>
>   <requestHandler name="/suggest" class="solr.SearchHandler" startup="lazy">
>     <lst name="defaults">
>       <str name="suggest">true</str>
>       <str name="suggest.count">10</str>
>     </lst>
>     <arr name="components">
>       <str>suggest</str>
>     </arr>
>   </requestHandler>
> {code}
> solrconfig changes -
> {code}
> <fieldType class="solr.TextField" name="textSuggest" positionIncrementGap="100">
>    <analyzer>
>       <tokenizer class="solr.StandardTokenizerFactory"/>
>       <filter class="solr.StandardFilterFactory"/>
>       <filter class="solr.LowerCaseFilterFactory"/>
>    </analyzer>
>   </fieldType>
>    <field name="suggestField" type="textSuggest" indexed="true" stored="true"/>
> {code}
> Add 3 documents - 
> {code}
> curl http://localhost:8983/solr/update/json?commit=true -H 'Content-type:application/json' -d '
> [ {"id" : "1", "suggestField" : "bass fishing"}, {"id" : "2", "suggestField" : "sea bass"}, {"id" : "3", "suggestField" : "sea bass fishing"} ]
> '
> {code}
> Query -
> {code}
> http://localhost:8983/solr/collection1/suggest?suggest.build=true&suggest.dictionary=mySuggester&q=bass&wt=json&indent=on
> {code}
> Response 
> {code}
> {
>   "responseHeader":{
>     "status":0,
>     "QTime":25},
>   "command":"build",
>   "suggest":{"mySuggester":{
>       "bass":{
>         "numFound":3,
>         "suggestions":[{
>             "term":"<b>bass</b> fishing",
>             "weight":0,
>             "payload":""},
>           {
>             "term":"sea <b>bass</b>",
>             "weight":0,
>             "payload":""},
>           {
>             "term":"sea <b>bass</b> fishing",
>             "weight":0,
>             "payload":""}]}}}}
> {code}
> The problem is in SolrSuggester Line 200 where we say lookup.lookup()
> This constructor does not take allTermsRequired and doHighlight since it's only tuneable to AnalyzingInfixSuggester and not the other lookup implementations.
> If different Lookup implementations have different params as their constructors, these sort of issues will always keep happening. Maybe we should not keep it generic and do instanceof checks and set params accordingly?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org