lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boon Low (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (SOLR-6648) AnalyzingInfixLookupFactory always highlights suggestions
Date Thu, 15 Jan 2015 23:37:35 GMT

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

Boon Low edited comment on SOLR-6648 at 1/15/15 11:37 PM:
----------------------------------------------------------

I have created a patche for this, in Lucene and Solr, so that highlighting and the Boolean
matching clause can be configured in solrconfig.xml, for *BlendedInfixSuggester* and *AnalyzingInfixSuggester*:

{code:xml}
   <lst name="suggester">
        <str name="name">..</str>
        <str name="lookupImpl">BlendedInfixLookupFactory</str>
        <str name="dictionaryImpl">DocumentDictionaryFactory</str>
         ...
        <str name="allTermsRequired">false</str>
        <str name="highlight">true</str>
     </lst>
{code}

If not configured, both 'highlighting' and 'allTermsRequired' default to *true.


was (Author: boonious):
I have created a patche for this, in Lucene and Solr, so that highlighting and the Boolean
matching clause can be configured in solrconfig.xml, for *BlendedInfixSuggester* and *AnalyzingInfixSuggester*:

{code:xml}
   <lst name="suggester">
        <str name="name">..</str>
        <str name="lookupImpl">BlendedInfixLookupFactory</str>
        <str name="dictionaryImpl">DocumentDictionaryFactory</str>
         ...
        <str name="allTermsRequired">false</str>
        <str name="highlighting">true</str>
     </lst>
{code}

If not configured, both 'highlighting' and 'allTermsRequired' default to *true.

> 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.0, 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


Mime
View raw message