lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject lucene-solr:master: SOLR-9685: documenting #tags in query DSL.
Date Thu, 14 Jun 2018 14:19:03 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/master 6f24be945 -> 052fede51


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

Branch: refs/heads/master
Commit: 052fede51d636ada3c21a01a5dfe59eeebf17814
Parents: 6f24be9
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:20:54 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/052fede5/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/052fede5/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