Isaac Hebsh created SOLR-5560:
---------------------------------

             Summary: Enable LocalParams without escaping the query
                 Key: SOLR-5560
                 URL: https://issues.apache.org/jira/browse/SOLR-5560
             Project: Solr
          Issue Type: Bug
          Components: query parsers
    Affects Versions: 4.6
            Reporter: Isaac Hebsh


This query should be a legit syntax:

http://localhost:8983/solr/collection1/select?debugQuery=true&defType=lucene&df=id&q=TERM1
 AND {!lucene df=text}(TERM2 TERM3 "TERM4 TERM5")

currently it isn't, because the LocalParams can be specified on a single term 
only.

[~billnbell] thinks it is a bug.

>From the mailing list:
{quote}
We want to set a LocalParam on a nested query. When quering with "v" inline 
parameter, it works fine:
http://localhost:8983/solr/collection1/select?debugQuery=true&defType=lucene&df=id&q=TERM1
 AND {!lucene df=text v="TERM2 TERM3 \"TERM4 TERM5\""}

the parsedquery_toString is
+id:TERM1 +(text:term2 text:term3 text:"term4 term5")

Query using the "_query_" also works fine:
http://localhost:8983/solr/collection1/select?debugQuery=true&defType=lucene&df=id&q=TERM1
 AND _query_:"{!lucene df=text}TERM2 TERM3 \"TERM4 TERM5\""

(parsedquery is exactly the same).

Obviously, there is the option of external parameter ({... 
v=$nestedq}&nestedq=...)

This is a good solution, but it is not practical, when having a lot of such 
nested queries.

BUT, when trying to put the nested query in place, it yields syntax error:
http://localhost:8983/solr/collection1/select?debugQuery=true&defType=lucene&df=id&q=TERM1
 AND {!lucene df=text}(TERM2 TERM3 "TERM4 TERM5")

org.apache.solr.search.SyntaxError: Cannot parse '(TERM2'

The previous options are less preferred, because the escaping that should be 
made on the nested query.
{quote}



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)

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

Reply via email to