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

David Smiley commented on SOLR-10321:
-------------------------------------

I think omitting blank highlights for wildcard specified fields is probably the 
way to go, and would be minor enough as to not warrant a request flag/param 
(configuration-itis).  One aspect of doing this is creating a HashSet of hl.fl 
values (up front) and then after highlighting, testing if the field to 
highlight is in the set or not.  If it isn't, then there's a wildcard 
somewhere.  Patches welcome :-)

Note that doing wildcard highlights on tons of fields, assuming 
hl.requiredFieldMatch=false, assuming analysis offset source, is probably 
relatively slow in and of itself, aside from the excessive noise of putting 
useless empty entries in the Solr response.  The underlying UnifiedHighlighter 
will loop over each field to produce a separate FieldHighlighter which 
separately analyzes the query to pull out pertinent terms and do other 
initialization.  For a setup like this, it's all redundant duplicated work per 
field.  This could probably be addressed at the UnifiedSolrHighlighter level 
but it'd be awkward, and may actually ideally need some support at the Lucene 
layer too.  It would probably have limitations such that a wildcard highlighted 
field would then not support per-field config options.

> Unified highlighter returns empty fields when using glob
> --------------------------------------------------------
>
>                 Key: SOLR-10321
>                 URL: https://issues.apache.org/jira/browse/SOLR-10321
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: highlighter
>    Affects Versions: 6.4.2
>            Reporter: Markus Jelsma
>            Priority: Minor
>             Fix For: 7.0
>
>
> {code}
> q=lama&hl.method=unified&hl.fl=content_*
> {code}
> returns:
> {code}
>   <lst 
> name="http://www.nu.nl/weekend/3771311/dalai-lama-inspireert-westen.html";>
>     <arr name="content_en"/>
>     <arr name="content_nl">
>       <str>Nobelprijs Voorafgaand aan zijn bezoek aan Nederland is de dalai 
> &lt;em&gt;lama&lt;/em&gt; in Noorwegen om te vieren dat 25 jaar geleden de 
> Nobelprijs voor de Vrede aan hem werd toegekend. Anders dan in Nederland 
> wordt de dalai &lt;em&gt;lama&lt;/em&gt; niet ontvangen in het Noorse 
> parlement. </str>
>     </arr>
>     <arr name="content_general"/>
>     <arr name="content_de"/>
>     <arr name="content_fr"/>
>     <arr name="content_es"/>
>     <arr name="content_pt"/>
>     <arr name="content_ja"/>
>     <arr name="content_zh-cn"/>
>     <arr name="content_th"/>
>     <arr name="content_ar"/>
>   </lst>
> {code}
> FastVector and original do not emit: 
> {code}
>     <arr name="content_de"/>
>     <arr name="content_fr"/>
>     <arr name="content_es"/>
>     <arr name="content_pt"/>
>     <arr name="content_ja"/>
>     <arr name="content_zh-cn"/>
>     <arr name="content_th"/>
>     <arr name="content_ar"/>
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to