lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikhail Khludnev (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (SOLR-9685) tag a query in JSON syntax
Date Tue, 01 May 2018 14:53:03 GMT

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

Mikhail Khludnev edited comment on SOLR-9685 at 5/1/18 2:52 PM:
----------------------------------------------------------------

[~squallsama], I'm afraid the proposed syntax is a way verbose. I propose to think about particular
usage. [Here|https://lucene.apache.org/solr/guide/7_1/json-query-dsl.html#use-json-query-dsl-in-json-request-api]
we have 
{code}
{
    "query": {
        "bool": {
            "must_not": "{!frange u:3.0}ranking"
        }
    },
    "filter: [
        "title:solr",
        { "lucene" : {"df: "content", query : "lucene solr" }}
    ]
}
{code}
I'd like to tag it like this
{code}
{
    "query": {
        "bool": {
            "must_not": "{!frange u:3.0}ranking"
        },
       "tag":"top"
    },
    "filter: [
        {"query":"title:solr",   // the most tricky one  
          "tag":"title"
        },
        { "lucene" : {"df: "content", query : "lucene solr" },
          "tag":"content" 
        }
    ]
}
{code}

Opinions? 
*UPD*
repeating {{tag}} is boring, let's shorten it to the single hash like this
{code}
{
    "query": {
      "#top":{
          "bool": {
            "must_not": "{!frange u:3.0}ranking"
       }  }
    },
    "filter: [
        {"#title":"title:solr"},
        { "#content": {"lucene" : {"df: "content", query : "lucene solr" }}}
    ]
}
{code} 


was (Author: mkhludnev):
[~squallsama], I'm afraid the proposed syntax is a way verbose. I propose to think about particular
usage. [Here|https://lucene.apache.org/solr/guide/7_1/json-query-dsl.html#use-json-query-dsl-in-json-request-api]
we have 
{code}
{
    "query": {
        "bool": {
            "must_not": "{!frange u:3.0}ranking"
        }
    },
    "filter: [
        "title:solr",
        { "lucene" : {"df: "content", query : "lucene solr" }}
    ]
}
{code}
I'd like to tag it like this
{code}
{
    "query": {
        "bool": {
            "must_not": "{!frange u:3.0}ranking"
        },
       "tag":"top"
    },
    "filter: [
        {"query":"title:solr",   // the most tricky one  
          "tag":"title"
        },
        { "lucene" : {"df: "content", query : "lucene solr" },
          "tag":"content" 
        }
    ]
}
{code}

Opinions? 

> tag a query in JSON syntax
> --------------------------
>
>                 Key: SOLR-9685
>                 URL: https://issues.apache.org/jira/browse/SOLR-9685
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: Facet Module, JSON Request API
>            Reporter: Yonik Seeley
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> There should be a way to tag a query/filter in JSON syntax.
> Perhaps these two forms could be equivalent:
> {code}
> "{!tag=COLOR}color:blue"
> { tagged : { COLOR : "color:blue" }
> {code}



--
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


Mime
View raw message