You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Mikhail Khludnev (JIRA)" <ji...@apache.org> on 2019/07/02 10:19:00 UTC

[jira] [Comment Edited] (SOLR-12490) referring/excluding clauses from JSON query DSL in JSON facets.

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

Mikhail Khludnev edited comment on SOLR-12490 at 7/2/19 10:18 AM:
------------------------------------------------------------------

Here is fewer-impact approach induced by chat with [~osavrasov]. *The proposal is to introduce {{json.queries}}, it's like arbitrary {{json.param}} but it's translated with query DSL* 

{code}
{
    "query" : {
      "#top":{
          "parent": {
              "query": "sku-title:foo",
              "filters" : "$childFq", // non-json old style param reference 
              "which": "scope:product"
           }
        }
    }, // like .param but parsed with query dsl syntax 
    "queries":{
         "childFq":[{ "#color" :"color:black" },
                    { "#size" : "size:L" }]
    },
    "facet":{
       "sku_colors_in_prods":{
          "type" : "terms",
          "field" : "color",
          "domain" : {
               "excludeTags":["top",       // we need to drop top-level parent query
                              "color"],    // excluding one child filter clause
               "filter":[ 
                      {"param":"childFq"}  // referring to .queries.childFq
               ]
           },
        "facet": {                         // counting products
              "prod_count":"uniqueBlock(_root_)"
           }
   }
}
}
{code}


was (Author: mkhludnev):
Here is fewer-impact approach induced by chat with [~osavrasov]. The proposal is to introduce {{json.queries}}, it's like arbitrary {{json.param}} but it's translated with query DSL 

{code}
{
    "query" : {
      "#top":{
          "parent": {
              "query": "sku-title:foo",
              "filters" : "$childFq", // non-json old style param reference 
              "which": "scope:product"
           }
        }
    }, // like .param but parsed with query dsl syntax 
    "queries":{
         "childFq":[{ "#color" :"color:black" },
                    { "#size" : "size:L" }]
    },
    "facet":{
       "sku_colors_in_prods":{
          "type" : "terms",
          "field" : "color",
          "domain" : {
               "excludeTags":["top",       // we need to drop top-level parent query
                              "color"],    // excluding one child filter clause
               "filter":[ 
                      {"param":"childFq"}  // referring to .queries.childFq
               ]
           },
        "facet": {                         // counting products
              "prod_count":"uniqueBlock(_root_)"
           }
   }
}
}
{code}

> referring/excluding clauses from JSON query DSL in JSON facets. 
> ----------------------------------------------------------------
>
>                 Key: SOLR-12490
>                 URL: https://issues.apache.org/jira/browse/SOLR-12490
>             Project: Solr
>          Issue Type: Improvement
>          Components: Facet Module, faceting
>            Reporter: Mikhail Khludnev
>            Priority: Major
>
> It's spin off from the [discussion|https://issues.apache.org/jira/browse/SOLR-9685?focusedCommentId=16508720&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-16508720]. 
> h2. Problem
> # after SOLR-9685 we can tag separate clauses in hairish queries like {{parent}}, {{bool}}
> # we can {{domain.excludeTags}}
> # we are looking for child faceting with exclusions, see SOLR-9510, SOLR-8998    
> # but we can refer only separate params in {{domain.filter}}, it's not possible to refer separate clauses
> see the first comment



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

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