You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mk...@apache.org on 2018/06/14 14:23:20 UTC
lucene-solr:branch_7x: SOLR-9685: documenting #tags in query DSL.
Repository: lucene-solr
Updated Branches:
refs/heads/branch_7x fffdc506b -> 73f2e57ab
SOLR-9685: documenting #tags in query DSL.
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/73f2e57a
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/73f2e57a
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/73f2e57a
Branch: refs/heads/branch_7x
Commit: 73f2e57ab0bf2a18798201037e0aa0a7616555f5
Parents: fffdc50
Author: Mikhail Khludnev <mk...@apache.org>
Authored: Thu Jun 14 17:19:41 2018 +0300
Committer: Mikhail Khludnev <mk...@apache.org>
Committed: Thu Jun 14 17:23:07 2018 +0300
----------------------------------------------------------------------
solr/solr-ref-guide/src/json-facet-api.adoc | 21 +++++++++++++++++++++
solr/solr-ref-guide/src/json-query-dsl.adoc | 17 +++++++++++++++++
2 files changed, 38 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/73f2e57a/solr/solr-ref-guide/src/json-facet-api.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/json-facet-api.adoc b/solr/solr-ref-guide/src/json-facet-api.adoc
index 183f940..a7766b2 100644
--- a/solr/solr-ref-guide/src/json-facet-api.adoc
+++ b/solr/solr-ref-guide/src/json-facet-api.adoc
@@ -320,6 +320,27 @@ The value of `filter` can be a single query to treat as a filter, or a list of f
* a string containing a query in Solr query syntax
* a reference to a request parameter containing Solr query syntax, of the form: `{param : <request_param_name>}`
+== Filter Exclusions
+One can exclude top-level filters and query *before* faceting via the `excludeTags` keywords in the `domain` block of the facet.
+
+Example:
+[source,bash]
+----
+&q={!tag=top}"running shorts"
+&fq={!tag=COLOR}color:Blue
+&json={
+ filter:"{!tag=BRAND}brand:Bosco"
+ facet:{
+ sizes:{type:terms, field:size},
+ colors:{type:terms, field:color, domain:{excludeTags:COLOR} },
+ brands:{type:terms, field:brand, domain:{excludeTags:"BRAND,top"} }
+ }
+}
+----
+
+The value of `excludeTags` can be a single string tag, array of string tags or comma-separated tags in the single string.
+See also the section on <<faceting.adoc#tagging-and-excluding-filters,multi-select faceting>>.
+
== Aggregation Functions
Aggregation functions, also called *facet functions, analytic functions,* or **metrics**, calculate something interesting over a domain (each facet bucket).
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/73f2e57a/solr/solr-ref-guide/src/json-query-dsl.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/json-query-dsl.adoc b/solr/solr-ref-guide/src/json-query-dsl.adoc
index 58d2baa..9c9ba64 100644
--- a/solr/solr-ref-guide/src/json-query-dsl.adoc
+++ b/solr/solr-ref-guide/src/json-query-dsl.adoc
@@ -168,3 +168,20 @@ curl -XGET http://localhost:8983/solr/books/query -d '
{ "lucene" : {"df: "content", query : "lucene solr" }}
]
}'
+
+== Tagging in JSON Query DSL
+Queries and filters might be tagged by inserting JSON object with the single property with name starting with a hash (`#`). Tags can be applied to the single string syntax and to a full JSON object query as well:
+
+[source,bash]
+curl -XGET http://localhost:8983/solr/books/query -d '
+{
+ "filter: [ // this applies `titletag`
+ {"#titletag": "title:solr"},
+ { // this applies `tagcontent`
+ "#tagcontent":
+ {"lucene": {"df:"content", query :"lucene solr"}}
+ }
+ ]
+}'
+
+There might be many comma separated tags like `{"#title,tag2,tag3":"title:solr"}`. Tags can be used in <<faceting.adoc#tagging-and-excluding-filters,old facets>> and in <<json-facet-api.adoc#filter-exclusions,JSON Facets'>> `excludeTags` as well. Notice that the leading hash requires to use double quotes as in regular JSON.