lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject lucene-solr:branch_7_4: SOLR-9685: documenting #tags in query DSL.
Date Thu, 14 Jun 2018 14:25:13 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/branch_7_4 325255766 -> 28616c427


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/28616c42
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/28616c42
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/28616c42

Branch: refs/heads/branch_7_4
Commit: 28616c42781699c2eeeea36f3ef5cddc84244a74
Parents: 3252557
Author: Mikhail Khludnev <mkhl@apache.org>
Authored: Thu Jun 14 17:19:41 2018 +0300
Committer: Mikhail Khludnev <mkhl@apache.org>
Committed: Thu Jun 14 17:26:51 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/28616c42/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/28616c42/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.


Mime
View raw message