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

Bruno Roustant edited comment on SOLR-14782 at 9/2/20, 9:17 AM:
----------------------------------------------------------------

[~smk] you should add a CharFilter to unescape for query elevation. Instead of 
using lowercase for the queryFieldType you could use unescapelowercase with the 
following definition:
{code:java}
<fieldType name="unescapelowercase" class="solr.TextField" 
positionIncrementGap="100">
  <analyzer>
    <charFilter class="solr.PatternReplaceCharFilterFactory" pattern="\\(.)" 
replacement="$1"/>
    <tokenizer class="solr.KeywordTokenizerFactory"/>
    <filter class="solr.LowerCaseFilterFactory"/>
  </analyzer>
</fieldType>{code}
[~dsmiley] this regex pattern replacement CharFilter is not easy. Should we 
have a new simpler and equivalent UnescapeCharFilterFactory? In any case I 
think it would be nice to add a paragraph to explain that in the 
QueryElevationComponent doc.


was (Author: broustant):
[~smk] you should add a CharFilter to unescape for query elevation. Instead of 
using lowercase for the queryFieldType you could use unescapelowercase with the 
following definition:
{code:java}
<fieldType name="unescapelowercase" class="solr.TextField" 
positionIncrementGap="100">
  <analyzer>
    <charFilter class="solr.PatternReplaceCharFilterFactory" pattern="\\\\(.)" 
replacement="$1"/>
    <tokenizer class="solr.KeywordTokenizerFactory"/>
    <filter class="solr.LowerCaseFilterFactory"/>
  </analyzer>
</fieldType>{code}
[~dsmiley] this regex pattern replacement CharFilter is not easy. Should we 
have a new simpler and equivalent UnescapeCharFilterFactory? In any case I 
think it would be nice to add a paragraph to explain that in the 
QueryElevationComponent doc.

> QueryElevationComponent does not handle escaped query terms
> -----------------------------------------------------------
>
>                 Key: SOLR-14782
>                 URL: https://issues.apache.org/jira/browse/SOLR-14782
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: query parsers
>    Affects Versions: 8.2
>            Reporter: Thomas Schmiereck
>            Assignee: Bruno Roustant
>            Priority: Major
>              Labels: elevation
>         Attachments: SOLR-14782.patch
>
>
> h1. Description
> if the elevate.xml contains a entry with spaces:
> <{color:#0033b3}query {color}{color:#174ad4}text{color}{color:#067d17}="aaa 
> bbb"{color}><{color:#0033b3}doc 
> {color}{color:#174ad4}id{color}{color:#067d17}="core2docId2" 
> {color}/></{color:#0033b3}query{color}>
> and the Solr query term is escaped:
> {{?q=aaa&#92;+bbb}}
> the Solr search itself handels this correctly, but the elevate component 
> "QueryElevationComponent" does not unescape the query term bevor the lookup 
> in the elevate.xml.
> Result is that the entry is not elevated.
> A also valid (not escaped) query like:
> {{?q=aaa%20bbb}}
> is working.
> h1. Technical Notes
> see:
> org.apache.solr.handler.component.QueryElevationComponent.MapElevationProvider#getElevationForQuery
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to