Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the Solr rule deployment script to support the Querqy 5 rule API #164

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mkr
Copy link
Collaborator

@mkr mkr commented Nov 6, 2024

The example smui2solr.sh was still using ssh based file upload to deploy Querqy rules, there is a new way with Querqy 5: the Querqy rewriter API.

  • New smui2solr.sh deployment script that uses the Querqy 5 API. It is triggered with 4 parameters
  1. the path to the common rules file
  2. the path to the replace rules file
  3. the target system, i.e. PRELIVE or LIVE
  4. the Solr core or collection name (taken from the rules collection)
  • The script expects all other configuration as environment variables:

    • SMUI_QUERQY_REWRITER_COMMON_RULES: the name of the common rules rewriter the rules should be deployed to
    • SMUI_QUERQY_REWRITER_COMMON_RULES_DECOMPOUND: the name of the common rules rewriter for decompound rules (required, if decompound rules shall be exported separately)
    • SMUI_QUERQY_REWRITER_REPLACE: the name of the replace rules rewriter (required, if spelling/replacement rules are used)
    • SMUI_2SOLR_SOLR_HOST or SMUI_DEPLOY_LIVE_SOLR_HOST: the live Solr host
    • SMUI_DEPLOY_PRELIVE_SOLR_HOST: the prelive Solr host, if prelive deployment is enabled
    • SMUI_DEPLOY_(PRE)LIVE_SOLR_(USER|PASSWORD): the live/prelive user/password if Solr basic authentication is used
    • SMUI_DEPLOY_PRELIVE_SOLR_ALLOW_INSECURE: if the --insecure flag should be used when authenticating (i.e. no cert validation)
  • Removing all configuration related to the target file names of the common rules, optional decompound common rules and replace rules file names as they are no longer copied to a target.

  • Changing the decision to trigger a GIT based rule deployment to a dedicated toggle / environment variable SMUI_DEPLOYMENT_GIT_ENABLE which needs to be set to true. No longer relying on the magic name "GIT" as the rules file name on the deployment target.

  • Add jq to SMUI Docker image to facilitate JSON based Querqy request recreation in smui2solr.sh script.

Copy link
Contributor

@epugh epugh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Where the G means GREAT. I expected this to be more in the vein of the smui2solrclud where we wedged in some python. I really appreciate that this is a refactoring, and that we removed more lines of code than we added by a big margin.

We should add something to the Docs to help folks upgrading know to review their setups.

@mkr mkr force-pushed the smui2solr_querqy5 branch from c6bb73d to f81be6e Compare November 25, 2024 09:32
…PI. The example smui2solr.sh was still using ssh based file upload to deploy Querqy rules, there is a new way with Querqy 5: the Querqy rewriter API.

* New smui2solr.sh deployment script that uses the Querqy 5 API. It is triggered with 4 parameters
  1) the path to the common rules file
  2) the path to the replace rules file
  3) the target system, i.e. PRELIVE or LIVE
  4) the Solr core or collection name (taken from the rules collection)
* The script expects all other configuration as environment variables:
  - SMUI_QUERQY_REWRITER_COMMON_RULES: the name of the common rules rewriter the rules should be deployed to
  - SMUI_QUERQY_REWRITER_COMMON_RULES_DECOMPOUND: the name of the common rules rewriter for decompound rules (required, if decompound rules shall be exported separately)
  - SMUI_QUERQY_REWRITER_REPLACE: the name of the replace rules rewriter (required, if spelling/replacement rules are used)
  - SMUI_2SOLR_SOLR_HOST or SMUI_DEPLOY_LIVE_SOLR_HOST: the live Solr host
  - SMUI_DEPLOY_PRELIVE_SOLR_HOST: the prelive Solr host, if prelive deployment is enabled
  - SMUI_DEPLOY_(PRE)LIVE_SOLR_(USER|PASSWORD): the live/prelive user/password if Solr basic authentication is used
  - SMUI_DEPLOY_PRELIVE_SOLR_ALLOW_INSECURE: if the --insecure flag should be used when authenticating (i.e. no cert validation)
* Removing all configuration related to the *target* file names of the common rules, optional decompound common rules and replace rules file names as they are no longer copied to a target.
* Changing the decision to trigger a GIT based rule deployment to a dedicated toggle / environment variable SMUI_DEPLOYMENT_GIT_ENABLE which needs to be set to true. No longer relying on the magic name "GIT" as the rules file name on the deployment target.
* Add jq to SMUI Docker image to facilitate JSON based Querqy request recreation in smui2solr.sh script.
@mkr mkr force-pushed the smui2solr_querqy5 branch from f81be6e to 62f5b42 Compare November 25, 2024 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants