Skip to content

Set Algolia index config for quarto.org programmatically #11892

@cwickham

Description

@cwickham

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"
    }
  ]
}

Metadata

Metadata

Assignees

Labels

documentationDoc improvements & quarto-web

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions