Alejandro Moratinos created JCR-5248:
----------------------------------------

             Summary: Support "indexHint" field in AuthorizableQueryManager 
JSON query format
                 Key: JCR-5248
                 URL: https://issues.apache.org/jira/browse/JCR-5248
             Project: Jackrabbit Content Repository
          Issue Type: Improvement
          Components: jackrabbit-jcr-commons
            Reporter: Alejandro Moratinos


AuthorizableQueryManager translates a JSON query into calls on jacrabkit api 
QueryBuilder, which UserManager#findAuthorizables(Query) then turns into the 
actual repository query.

The JSON format currently supports \{{selector}}, \{{scope}}, \{{condition}}, 
\{{order}}/\{{sort}} and \{{limit}}, but offers no way to influence which index 
is used to evaluate the query.

 

Proposed change

  Add support for a new optional top-level string field \{{indexHint}} in the 
JSON query format. When present, its value is passed to 
\{{QueryBuilder#setIndexTag(String)}}, which forces the underlying query to use 
an index marked with that tag (translated to an \{{option(index tag 
<indexHint>)}} clause by the query engine).

  Example:
  \{code:json}
  {
    "selector": "user",
    "indexHint": "myTag",
    "condition": [ \{ "eq": { "property": "@prop", "value": "x" } } ]
  }
  \{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to