(query: string)
| 173 | } |
| 174 | |
| 175 | public searchWithQuery(query: string): Promise<SearchResultItem[] | undefined> { |
| 176 | return this.client |
| 177 | .search([ |
| 178 | { |
| 179 | indexName: this.config.algolia.indexName, |
| 180 | params: { |
| 181 | query: query, |
| 182 | maxValuesPerFacet: MAX_VALUE_PER_FACET, |
| 183 | attributesToRetrieve: [ |
| 184 | 'hierarchy.lvl0', |
| 185 | 'hierarchy.lvl1', |
| 186 | 'hierarchy.lvl2', |
| 187 | 'hierarchy.lvl3', |
| 188 | 'hierarchy.lvl4', |
| 189 | 'hierarchy.lvl5', |
| 190 | 'hierarchy.lvl6', |
| 191 | 'content', |
| 192 | 'type', |
| 193 | 'url', |
| 194 | ], |
| 195 | hitsPerPage: 20, |
| 196 | snippetEllipsisText: '…', |
| 197 | highlightPreTag: '<ɵ>', |
| 198 | highlightPostTag: '</ɵ>', |
| 199 | attributesToHighlight: [], |
| 200 | attributesToSnippet: [ |
| 201 | 'hierarchy.lvl1:10', |
| 202 | 'hierarchy.lvl2:10', |
| 203 | 'hierarchy.lvl3:10', |
| 204 | 'hierarchy.lvl4:10', |
| 205 | 'hierarchy.lvl5:10', |
| 206 | 'hierarchy.lvl6:10', |
| 207 | 'content:10', |
| 208 | ], |
| 209 | }, |
| 210 | type: 'default', |
| 211 | }, |
| 212 | ]) |
| 213 | .then((response: SearchResponses<unknown>) => { |
| 214 | return this.parseResult(response); |
| 215 | }); |
| 216 | } |
| 217 | } |
| 218 | |
| 219 | function matched(snippet: SnippetResult | undefined): boolean { |
no test coverage detected