feat: set analyzer for elasticsearch (#2793)
* Feature: Custom configuration for elasticsearch For better search results especially in Chinese, which the standard token analyzer may not work well. * Set default analyzer in settings when building index * Remove dangling comma
This commit is contained in:
@@ -70,7 +70,16 @@ module.exports = {
|
||||
body: {
|
||||
mappings: (this.config.apiVersion === '6.x') ? {
|
||||
_doc: idxBody
|
||||
} : idxBody
|
||||
} : idxBody,
|
||||
settings: {
|
||||
analysis: {
|
||||
analyzer: {
|
||||
default: {
|
||||
type: this.config.analyzer
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
} catch (err) {
|
||||
|
Reference in New Issue
Block a user