- This plugin uses gradle wrapper for build and package management.
- Build Plugin: To build and install the plugin follow steps mentioned in the README.
- Install Plugin with pre-built packages: To install pre-built zip-packages follow steps mentioned in the README.
- Release documentation: Checkout our release steps here
The plugin works similar to Querqy’s ES plugin
- By René Kriegler @renekrie, Querqy Co-author & Maintainer
The Querqy plugin needs three configuration settings:
- Querqy Index number of replicas
- Rules cache expire time after write operation
- Rules cache expire time after read operation
NOTE: More details on caching in section 1.5
Querqy index → .opensearch-querqy
All the Querqy configurations like rules, synonyms, word breaks, etc will be stored in a new plugin index called .opensearch-querqy.
For each rewriter a separate doc is formed inside the index. Below is a sample of common_rules
stored in the plugin.
GET /.opensearch-querqy/_doc/common_rules
{
"_index" : ".opensearch-querqy",
"_type" : "_doc",
"_id" : "common_rules",
"_version" : 3,
"_seq_no" : 2,
"_primary_term" : 3,
"found" : true,
"_source" : {
"type" : "rewriter",
"version" : 3,
"class" : "querqy.opensearch.rewriter.SimpleCommonRulesRewriterFactory",
"config_v_003" : """{"rules":"request =>\nSYNONYM: POST"}"""
}
}
Usually users have thousand of rules in their index. Processing these rules and converting them to object factories take considerable amount of time, this processing cannot be done per request. Hence, the plugin resorts to caching the processed rules. The cache is build for each rewriter on the first search request made by any user. The cache stored is reloaded with each PUT request
made to the querqy plugin. The cache is cleared when a particular rewriter is deleted with a DELETE request
.
- Users querying over an index with or w/o Querqy should have access to read/search that index. The security plugin will block the user for any unauthorized access based on the permissions mapped to the user’s role.
Plugin Users: Admin User : creating rules read/update/delete [All CRUD] Search User: searches with querqy, not to view the rules but use it. [Only Read]
- Querqy Index: This stores all the rules
.opensearch-querqy
- Querqy Query Component: This is responsible for using rules and applying it to index search queries made by the user
- Approach 1:
- Only the users having read access to the Querqy index, can use the plugin with the search API.
- Only the users having write permissions on the Querqy index, can add/configure rules to the plugin.
- For users not having the access, we straight away deny request with
403
error response.
- Approach 2:
- All the users can use the plugin with the search API.
- Only the users having write permissions on the Querqy index, can add/configure/delete rules to the plugin.
- For users not having the access, we straight away deny request with
403
error response.
LIMITATION: The current implementation of the plugin follows OpenSearch FGAC over search indices. The Querqy Index needs FGAC permissions for editing and viewing rules. But, the plugin maintains a global cache across users, for processed rules.
More discussion about the issue here: #14
- Contributing to the project: https://github.com/querqy/querqy-opensearch/blob/main/CONTRIBUTING.md
- Release documentation: https://github.com/querqy/querqy-opensearch/blob/main/RELEASING.md
- Querqy project docs: https://querqy.org/
- Querqy project github: https://github.com/querqy
- Querqy ElasticSearch Plugin Details: https://github.com/querqy/querqy-elasticsearch
- Querqy 5: https://opensourceconnections.com/blog/2021/03/05/whats-new-in-querqy-the-query-preprocessor-for-solr-and-elasticsearch/