chore: update meilisearch settings (#10659)

* chore: update meilisearch settings

* fix: docker build
This commit is contained in:
Tony
2022-08-30 09:29:51 -09:00
committed by GitHub
parent 3c7cd655e9
commit fee049146e
4 changed files with 75 additions and 1 deletions

View File

@@ -0,0 +1,55 @@
const { MeiliSearch } = require('meilisearch');
module.exports = async ({ core }, host, apiKey) => {
const client = new MeiliSearch({
host,
apiKey,
});
core.info('Updating displayed attributes');
core.info(
await client
.index('rsshub')
.updateDisplayedAttributes([
'hierarchy_radio_lvl1',
'hierarchy_radio_lvl2',
'hierarchy_radio_lvl3',
'hierarchy_radio_lvl4',
'hierarchy_radio_lvl5',
'hierarchy_lvl0',
'hierarchy_lvl1',
'hierarchy_lvl2',
'hierarchy_lvl3',
'hierarchy_lvl4',
'hierarchy_lvl5',
'hierarchy_lvl6',
'anchor',
'url',
'content',
])
);
core.info('Updating searchable attributes');
core.info(
await client
.index('rsshub')
.updateSearchableAttributes([
'hierarchy_radio_lvl1',
'hierarchy_radio_lvl2',
'hierarchy_radio_lvl3',
'hierarchy_radio_lvl4',
'hierarchy_radio_lvl5',
'hierarchy_lvl0',
'hierarchy_lvl1',
'hierarchy_lvl2',
'hierarchy_lvl3',
'hierarchy_lvl4',
'hierarchy_lvl5',
'hierarchy_lvl6',
'anchor',
'content',
])
);
core.info('Updating sortable attributes');
core.info(await client.index('rsshub').updateSortableAttributes(['anchor']));
};