mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-29 12:42:46 +00:00
Fulltext implementation using Bleve (#2675)
Based on #2480 This actually indexes events based on their event type. They are removed from the index if we receive a `m.room.redaction` event on the `OutputRoomEvent` stream. An admin endpoint is added to reindex all existing events. Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
This commit is contained in:
parent
6c67552bf9
commit
87be32ca26
22 changed files with 680 additions and 53 deletions
|
@ -10,7 +10,7 @@ type SyncAPI struct {
|
|||
|
||||
RealIPHeader string `yaml:"real_ip_header"`
|
||||
|
||||
Fulltext Fulltext `yaml:"fulltext"`
|
||||
Fulltext Fulltext `yaml:"search"`
|
||||
}
|
||||
|
||||
func (c *SyncAPI) Defaults(opts DefaultOpts) {
|
||||
|
@ -52,16 +52,12 @@ func (f *Fulltext) Defaults(opts DefaultOpts) {
|
|||
f.Enabled = false
|
||||
f.IndexPath = "./fulltextindex"
|
||||
f.Language = "en"
|
||||
if opts.Generate {
|
||||
f.Enabled = true
|
||||
f.InMemory = true
|
||||
}
|
||||
}
|
||||
|
||||
func (f *Fulltext) Verify(configErrs *ConfigErrors, isMonolith bool) {
|
||||
if !f.Enabled {
|
||||
return
|
||||
}
|
||||
checkNotEmpty(configErrs, "syncapi.fulltext.index_path", string(f.IndexPath))
|
||||
checkNotEmpty(configErrs, "syncapi.fulltext.language", f.Language)
|
||||
checkNotEmpty(configErrs, "syncapi.search.index_path", string(f.IndexPath))
|
||||
checkNotEmpty(configErrs, "syncapi.search.language", f.Language)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue