You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by ca...@apache.org on 2018/12/08 11:18:49 UTC

svn commit: r1848455 - in /jackrabbit/oak/trunk/oak-doc/src/site/markdown/query: lucene.md query-engine.md

Author: catholicon
Date: Sat Dec  8 11:18:49 2018
New Revision: 1848455

URL: http://svn.apache.org/viewvc?rev=1848455&view=rev
Log:
OAK-301: Document Oak

Modified:
    jackrabbit/oak/trunk/oak-doc/src/site/markdown/query/lucene.md
    jackrabbit/oak/trunk/oak-doc/src/site/markdown/query/query-engine.md

Modified: jackrabbit/oak/trunk/oak-doc/src/site/markdown/query/lucene.md
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-doc/src/site/markdown/query/lucene.md?rev=1848455&r1=1848454&r2=1848455&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-doc/src/site/markdown/query/lucene.md (original)
+++ jackrabbit/oak/trunk/oak-doc/src/site/markdown/query/lucene.md Sat Dec  8 11:18:49 2018
@@ -1345,6 +1345,8 @@ Specific facet related features for Luce
           - propertyIndex = true
 ```
 
+See [query-engine](query-engine.html#Facets) regarding how to query to evaluate facets alongwith.
+
 #### <a name="score-explanation"></a>Score Explanation
 
 `@since Oak 1.3.12`

Modified: jackrabbit/oak/trunk/oak-doc/src/site/markdown/query/query-engine.md
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-doc/src/site/markdown/query/query-engine.md?rev=1848455&r1=1848454&r2=1848455&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-doc/src/site/markdown/query/query-engine.md (original)
+++ jackrabbit/oak/trunk/oak-doc/src/site/markdown/query/query-engine.md Sat Dec  8 11:18:49 2018
@@ -547,6 +547,18 @@ field in Lucene / Solr) using the follow
 
 Nodes/Rows can still be retrieved from within the QueryResult object the usual way.
 
+Do note that retrieving facets don't affect the result set or query constraints. So, only those
+indexes which can resolve the query constraints would be considered for resolving the query.
+For lucene indexes the index must also index relevant properties for faceting to be considered
+for evaluating the query. So, a query like:
+
+    SELECT [rep:facet(jcr:title)] FROM [nt:unstructured]
+
+can only be resolved by an index which is indexing all `nt:unstructured` nodes. Following query is
+is what should be used to get facets from nodes which have existing faceted proeprty:
+
+    SELECT [rep:facet(jcr:title)] FROM [nt:unstructured] WHERE [jcr:title] IS NOT NULL 
+
 ### XPath to SQL-2 Transformation
 
 To support the XPath query language, such queries are internally converted to SQL-2.