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

Thomas Egense commented on SOLR-6376:
-------------------------------------

Thanks for looking into this 5 year old bug :)

Sorry, I just managed to reproduce the error in solr  8.1.1

In the */browse* handler add the following:

<requestHandler name="/browse" class="solr.SearchHandler">
     <lst name="defaults">
       <str name="echoParams">explicit</str>

       *<str name="f.name_features.qf">name features XXX </str>   <-- the new 
line  XXX is a non existing field*

*...*

 

**Then you search: 
[http://localhost:8983/solr/gettingstarted/browse?q=name_features%3Avideo]

query  is    name_features:video

and hit 3 results. This is correct.

But if you search for: 
[http://localhost:8983/solr/gettingstarted/browse?q=name_features%3Avideo+AND+name_features%3Avideo]

You get 0 results and this is incorrect. You should get 3 results as well.

query is     name_features:video AND   name_features:video

(just the same twice)

If you  instead add the correct field mapping to the handler, everything works 
fine. Here both field are defined.

       *<str name="f.name_features.qf">name features</str>* 

/Thomas Egense

 

 

> Edismax field alias bug
> -----------------------
>
>                 Key: SOLR-6376
>                 URL: https://issues.apache.org/jira/browse/SOLR-6376
>             Project: Solr
>          Issue Type: Bug
>          Components: query parsers
>    Affects Versions: 4.6.1, 4.7, 4.7.2, 4.8, 4.9, 4.10.1
>            Reporter: Thomas Egense
>            Priority: Minor
>              Labels: difficulty-easy, edismax, impact-low
>         Attachments: SOLR-6376.patch, SOLR-6376.patch
>
>
> If you create a field alias that maps to a nonexistent field, the query will 
> be parsed to utter garbage.
> The bug can reproduced very easily. Add the following line to the /browse 
> request handler in the tutorial example solrconfig.xml
> <str name="f.name_features.qf">name features XXX</str>
> (XXX is a nonexistent field)
> This simple query will actually work correctly: 
> name_features:video
> and it will be parsed to  (features:video | name:video) and return 3 results. 
> It has simply discarded the nonexistent field and the result set is correct.
> However if you change the query to:
> name_features:video AND name_features:video
> you will now get 0 result and the query is parsed to 
> +(((features:video | name:video) (id:AND^10.0 | author:and^2.0 | 
> title:and^10.0 | cat:AND^1.4 | text:and^0.5 | keywords:and^5.0 | manu:and^1.1 
> | description:and^5.0 | resourcename:and | name:and^1.2 | features:and) 
> (features:video | name:video))~3)
> Notice the AND operator is now used a term! The parsed query can turn out 
> even worse and produce query parts such as:
> title:2~2    
> title:and^2.0^10.0  
> Prefered solution: During start up, shut down Solr if there is a nonexistant 
> field alias. Just as is the case if the cycle-detection detects a cycle:
> Acceptable solution: Ignore the nonexistant field totally.
> Thomas Egense



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to