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

Cao Manh Dat edited comment on SOLR-11244 at 8/28/17 1:44 AM:
--------------------------------------------------------------

bq. What about multi-valued parameters
It seems that local params work well in this case. As you can see, dismax 
qparser has multiple-value parameters (qf field) and it also tested in the 
patch.
{code}
{ 
 query : { 
  dismax : { 
   query : 'A NJ' 
   qf : ['cat_s^100', 'where_s^0.1'] 
  }  
 },  
 filter : '-id:2', 
 fields : id 
}
{code}
Another test is bool qparser, Its 'should' field is multi-value which contain 
sub-queries.
{code}
{  
  'query': {    
    'bool' : {      
      'should' : [        
        'id:1',        
        'id:2'      
      ]    
    }  
  }
}
{code}
The above query will be rewritten into {!bool should='id:1' should='id:2'}
bq. Is that really the full patch (16K)?
Yeah, that's the full patch :)



was (Author: caomanhdat):
bq. What about multi-valued parameters
It seems that local params work well in this case. As you can see, dismax 
qparser has multiple-value parameters (qf field) and it also tested in the 
patch.
{code}
{ 
 query : { 
  dismax : { 
   query : 'A NJ' 
   qf : ['cat_s^100', 'where_s^0.1'] 
  }  
 },  
 filter : '-id:2', 
 fields : id 
}
{code}
Another test is bool qparser, Its 'should' field is multi-value which contain 
sub-queries.
{code}
{  
  'query': {    
    'bool' : {      
      'should' : [        
        'id:1',        
        'id:2'      
      ]    
    }  
  }
}
{code}
bq. Is that really the full patch (16K)?
Yeah, that's the full patch :)


> Query DSL for Solr
> ------------------
>
>                 Key: SOLR-11244
>                 URL: https://issues.apache.org/jira/browse/SOLR-11244
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Cao Manh Dat
>            Assignee: Cao Manh Dat
>         Attachments: SOLR-11244.patch, SOLR-11244.patch, SOLR-11244.patch, 
> Solr Query DSL - examples.html
>
>
> It will be great if Solr has a powerful query DSL. This ticket is an 
> extension of [http://yonik.com/solr-json-request-api/].
> Here are several examples of Query DSL
> {code}
> curl -XGET http://localhost:8983/solr/query -d '
> {
>     "query" : {
>         "lucene" : {
>             "df" : "content",
>             "query" : "solr lucene"
>         }
>     }
> }
> {code}
> the above example can be rewritten as (because lucene is the default qparser)
> {code}
> curl -XGET http://localhost:8983/solr/query -d '
> {
>     "query" : "content:(solr lucene)"
> }
> {code}
> more complex example:
> {code}
> curl -XGET http://localhost:8983/solr/query -d '
> { 
>     "query" : {
>         "boost" : {
>             "query" : {
>                 "lucene" : {
>                     "q.op" : "AND",
>                     "df" : "cat_s",
>                     "query" : "A"
>                 }
>             }
>             "b" : "log(popularity)"
>         }
>     }
> }
> {code}
> I call it Json Query Object (JQO) and It defined as :
> - It can be a valid query string for Lucene query parser, for example : 
> "title:solr"
> - It can be a valid local parameters string, for example : "{!dismax 
> qf=myfield}solr rocks"
> - It can be a json object with structure like this 
> {code}
> {
>   "query-parser-name" : {
>      "param1" : "value1",
>      "param2" : "value2",
>      "query" : <JQO>,
>      "another-param" : <JQO>
>   }
> }
> {code}
> Therefore the above dismax query can be rewritten as ( be noticed that the 
> query argument in local parameters, is put as value of {{query}} field )
> {code}
> {
>   "dismax" : {
>      "qf" : "myfield"
>      "query" : "solr rocks"
>   }
> }
> {code}
> I will attach an HTML, contain more examples of Query DSL.



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

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

Reply via email to