1
- import * as page from "./page" ;
1
+ const page = require ( "./page" ) ;
2
2
3
3
// Algolia index settings.
4
4
//
5
5
// Changes to this file should be made with extreme care.
6
+ module . exports = {
6
7
7
8
// Attributes for faceting are the properties to use for top-level filtering of results -- for
8
9
// example, whether a given record is returned for a "Docs" query, "Registry" query, and so on.
9
10
// https://www.algolia.com/doc/api-reference/api-parameters/attributesForFaceting/
10
- export function getAttributesForFaceting ( ) {
11
+ getAttributesForFaceting ( ) {
11
12
return [
12
13
"searchable(section)" ,
13
14
] ;
14
- }
15
+ } ,
15
16
16
17
// Synonyms allow us to surface content that may not directly match users' queries.
17
18
// https://www.algolia.com/doc/api-reference/api-methods/save-synonyms/#save-synonyms
18
- export function getSynonyms ( ) {
19
+ getSynonyms ( ) {
19
20
return [
20
21
[ ".NET" , "dotnet" ] ,
21
22
[ "aws" , "aws classic" ] ,
@@ -47,7 +48,7 @@ import * as page from "./page";
47
48
synonyms,
48
49
} ;
49
50
} ) ;
50
- }
51
+ } ,
51
52
52
53
// Searchable attributes control the fields that Algolia uses for query matching, as well as how
53
54
// relevant those fields are in relation to one another.
@@ -57,7 +58,7 @@ import * as page from "./page";
57
58
// the change on an index that isn't production.
58
59
//
59
60
// https://www.algolia.com/doc/guides/sending-and-managing-data/prepare-your-data/how-to/setting-searchable-attributes/#set-searchable-attributes-with-the-api
60
- export function getSearchableAttributes ( ) {
61
+ getSearchableAttributes ( ) {
61
62
return [
62
63
"title,h1" , // Title and H1 are considered of equal relevance, so they're listed on the same level.
63
64
"keywords" , // Keywords are treated as ordered. Those higher up in the list are considered more relevant.
@@ -68,25 +69,25 @@ import * as page from "./page";
68
69
"section" , // Section is the primary "facet" of a record -- Docs, Registry, Blog, Examples, etc.
69
70
"unordered(authors)" , // Blog-post authors are occasionally useful for searching, but their order is considered irrelevant.
70
71
] ;
71
- }
72
+ } ,
72
73
73
74
// Attributes to highlight contains the list of searchable attributes that might be used to highlight query matches in the UI.
74
75
// https://www.algolia.com/doc/api-reference/api-parameters/attributesToHighlight/
75
- export function getAttributesToHighlight ( ) {
76
+ getAttributesToHighlight ( ) {
76
77
return [
77
78
"title" ,
78
79
"h1" ,
79
80
"description" ,
80
81
] ;
81
- }
82
+ } ,
82
83
83
84
// Custom rankings are the attributes that Algolia uses for determining relative ranking --
84
85
// specifically for breaking ties between records that rank similarly for text matching. Similar
85
86
// to the above, order here is significant as well, so any changes here should be made with
86
87
// equal care.
87
88
//
88
89
// https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/how-to/configure-custom-ranking
89
- export function getCustomRanking ( ) {
90
+ getCustomRanking ( ) {
90
91
return [
91
92
92
93
// https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/how-to/configure-custom-ranking/#configure-custom-ranking-with-the-api
@@ -95,12 +96,12 @@ import * as page from "./page";
95
96
// https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/how-to/boost-or-penalize-some-records/#using-the-api
96
97
"desc(boosted)" ,
97
98
] ;
98
- }
99
+ } ,
99
100
100
101
// Rules are explicit instructions that apply fine-grained control over how certain queries are handled.
101
102
// https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/
102
103
// https://www.algolia.com/doc/api-reference/api-methods/save-rule
103
- export function getRules ( ) {
104
+ getRules ( ) {
104
105
return [
105
106
106
107
// When the query is for "cloud", deliver the Pulumi Cloud overview page as the top result.
@@ -207,4 +208,5 @@ import * as page from "./page";
207
208
} ,
208
209
} ,
209
210
] ;
210
- }
211
+ } ,
212
+ } ;
0 commit comments