0.1.4 • Published 4 months ago

algolia-query-rules-to-typesense v0.1.4

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
4 months ago

algolia-query-rules-to-typesense

This is a simple CLI utility to convert query rules from Algolia to Typesense's Override API JSON.

Usage:

npx algolia-query-rules-to-typesense <path/to/algolia_rules_export.json> <path/to/typesense_overrides_output.json>

To get algolia_rules_export.json, go to the "Rules" section of your Algolia index, and you'll find a download icon to export the rules as JSON.

This is the expected format of algolia_rules_export.json:

[
  {
    "description": "Test Rule",
    "conditions": [
      {
        "anchoring": "is",
        "pattern": "keyword",
        "alternatives": true
      }
    ],
    "consequence": {
      "params": {
        "filters": "..."
      },
      "filterPromotes": true
    },
    "enabled": true,
    "objectID": "qr-1682441011"
  }
]

After running this command, the output JSON will be in this format:

[
  {
    "id": "Test Rule - qr-1682441011",
    "rule": {
      "query": "keyword",
      "match": "exact"
    },
    "filter_curated_hits": true,
    "filter_by": "..."
  }
]

You can then import these JSON rules into Typesense using the Typesense API.

0.1.4

4 months ago

0.1.3

4 months ago

0.1.2

5 months ago

0.1.1

5 months ago

0.1.0

6 months ago