[
https://issues.apache.org/jira/browse/SOLR-9685?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16479895#comment-16479895
]
Yonik Seeley edited comment on SOLR-9685 at 5/17/18 11:47 PM:
--------------------------------------------------------------
Thanks Mikhail, I like the syntax!
bq. omitting leading # is illegal and causes exception
Not really... valid queries are also of the form { "query_type" : "query_val },
so the "#" disambiguates between a query type and a tag. For example, "join"
would cause a join query to be parsed, while "#join" would mean a tag.
bq. Leading # is kept in the tag name.
That will cause confusion for people switching between multiple styles of
tagging. We already have established uses of tags without hashes in them:
{code}
fq={!tag=color}item_color:blue
{code}
Also, we already have a way to add multiple tags via comma separation:
{code}
fq={!tag=color,item_description}item_color:blue
{code}
So the JSON equivalent should be:
{code}
{ "#color,item_description" : "item_color:blue" }
{code}
was (Author: [email protected]):
Thanks Mikhail, I like the syntax!
.bq omitting leading # is illegal and causes exception
Not really... valid queries are also of the form { "query_type" : "query_val },
so the "#" disambiguates between a query type and a tag. For example, "join"
would cause a join query to be parsed, while "#join" would mean a tag.
.bq Leading # is kept in the tag name.
That will cause confusion for people switching between multiple styles of
tagging. We already have established uses of tags without hashes in them:
{code}
fq={!tag=color}item_color:blue
{code}
Also, we already have a way to add multiple tags via comma separation:
{code}
fq={!tag=color,item_description}item_color:blue
{code}
So the JSON equivalent should be:
{code}
{ "#color,item_description" : "item_color:blue" }
{code}
> 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: 1.5h
> 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: [email protected]
For additional commands, e-mail: [email protected]