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

Set Algolia index config for quarto.org programmatically #11892

Open
cwickham opened this issue Jan 17, 2025 · 0 comments
Open

Set Algolia index config for quarto.org programmatically #11892

cwickham opened this issue Jan 17, 2025 · 0 comments
Labels
documentation Doc improvements & quarto-web

Comments

@cwickham
Copy link
Collaborator

We should store our search index configuration somewhere in quarto-web so it can be under version control.

We could then make configuring the index settings part of the Upload Index workflow by using set_settings() in upload-algolia.rb

For example, our current configuration for prod_QUARTO (exported from web GUI 2025-01-17) is:

{
  "settings": {
    "minWordSizefor1Typo": 4,
    "minWordSizefor2Typos": 8,
    "hitsPerPage": 20,
    "maxValuesPerFacet": 100,
    "attributesToIndex": [
      "unordered(title)",
      "unordered(section)",
      "unordered(text)",
      "unordered(href)"
    ],
    "numericAttributesToIndex": null,
    "attributesToRetrieve": null,
    "unretrievableAttributes": null,
    "optionalWords": null,
    "attributesForFaceting": null,
    "attributesToSnippet": null,
    "attributesToHighlight": null,
    "paginationLimitedTo": 1000,
    "attributeForDistinct": null,
    "exactOnSingleWordQuery": "attribute",
    "synonyms": [
      [
        "math",
        "maths"
      ]
    ],
    "ranking": [
      "typo",
      "geo",
      "words",
      "filters",
      "proximity",
      "attribute",
      "exact",
      "custom"
    ],
    "customRanking": [
      "desc(guide)"
    ],
    "separatorsToIndex": "\"_\"",
    "removeWordsIfNoResults": "none",
    "queryType": "prefixLast",
    "highlightPreTag": "<em>",
    "highlightPostTag": "</em>",
    "alternativesAsExact": [
      "ignorePlurals",
      "singleWordSynonym"
    ]
  },
  "rules": [],
  "synonyms": [
    {
      "type": "synonym",
      "synonyms": [
        "math",
        "maths"
      ],
      "objectID": "ai_optim_515edecd-2e6b-4a7b-8a92-7b17df3745e8"
    }
  ]
}
@cwickham cwickham added the documentation Doc improvements & quarto-web label Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Doc improvements & quarto-web
Projects
None yet
Development

No branches or pull requests

1 participant