mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-19 16:13:06 +00:00
feat: improve search experience
This commit is contained in:
@@ -43,6 +43,27 @@ export const fieldmap: ElasticsearchFieldmap = {
|
||||
},
|
||||
ignore: ['price'],
|
||||
},
|
||||
suggestable: {
|
||||
default: {
|
||||
trigram: {
|
||||
type: 'text',
|
||||
analyzer: 'trigram',
|
||||
},
|
||||
reverse: {
|
||||
type: 'text',
|
||||
analyzer: 'reverse',
|
||||
},
|
||||
},
|
||||
ignore: [],
|
||||
},
|
||||
completable: {
|
||||
default: {
|
||||
completion: {
|
||||
type: 'search_as_you_type',
|
||||
},
|
||||
},
|
||||
ignore: [],
|
||||
},
|
||||
};
|
||||
|
||||
export const filterableTagName = 'filterable';
|
||||
|
||||
@@ -19,4 +19,27 @@ export const settings: IndicesPutTemplateRequest['settings'] = {
|
||||
'max_result_window': 30_000,
|
||||
'number_of_replicas': 0,
|
||||
'number_of_shards': 1,
|
||||
'index': {
|
||||
analysis: {
|
||||
analyzer: {
|
||||
trigram: {
|
||||
type: 'custom',
|
||||
tokenizer: 'standard',
|
||||
filter: ['lowercase', 'shingle'],
|
||||
},
|
||||
reverse: {
|
||||
type: 'custom',
|
||||
tokenizer: 'standard',
|
||||
filter: ['lowercase', 'reverse'],
|
||||
},
|
||||
},
|
||||
filter: {
|
||||
shingle: {
|
||||
type: 'shingle',
|
||||
min_shingle_size: 2,
|
||||
max_shingle_size: 3,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user