aboutsummaryrefslogtreecommitdiff
path: root/setup
diff options
context:
space:
mode:
authorTill <2353100+S7evinK@users.noreply.github.com>2022-09-27 18:06:49 +0200
committerGitHub <noreply@github.com>2022-09-27 18:06:49 +0200
commit87be32ca2671173a4287a938932e543410a32c3a (patch)
tree92d74544fccf5f51873db4f55c04045562990b35 /setup
parent6c67552bf9eee18f656d731adf646aa09c5d7c92 (diff)
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>
Diffstat (limited to 'setup')
-rw-r--r--setup/base/base.go7
-rw-r--r--setup/config/config_syncapi.go10
2 files changed, 6 insertions, 11 deletions
diff --git a/setup/base/base.go b/setup/base/base.go
index 32716c76..0636c7b8 100644
--- a/setup/base/base.go
+++ b/setup/base/base.go
@@ -37,16 +37,13 @@ import (
"golang.org/x/net/http2"
"golang.org/x/net/http2/h2c"
+ "github.com/matrix-org/dendrite/internal"
"github.com/matrix-org/dendrite/internal/caching"
"github.com/matrix-org/dendrite/internal/fulltext"
"github.com/matrix-org/dendrite/internal/httputil"
"github.com/matrix-org/dendrite/internal/pushgateway"
"github.com/matrix-org/dendrite/internal/sqlutil"
- "github.com/matrix-org/dendrite/internal"
- "github.com/matrix-org/dendrite/setup/jetstream"
- "github.com/matrix-org/dendrite/setup/process"
-
"github.com/gorilla/mux"
"github.com/kardianos/minwinsvc"
@@ -61,6 +58,8 @@ import (
roomserverAPI "github.com/matrix-org/dendrite/roomserver/api"
rsinthttp "github.com/matrix-org/dendrite/roomserver/inthttp"
"github.com/matrix-org/dendrite/setup/config"
+ "github.com/matrix-org/dendrite/setup/jetstream"
+ "github.com/matrix-org/dendrite/setup/process"
userapi "github.com/matrix-org/dendrite/userapi/api"
userapiinthttp "github.com/matrix-org/dendrite/userapi/inthttp"
)
diff --git a/setup/config/config_syncapi.go b/setup/config/config_syncapi.go
index c890b005..edef22c9 100644
--- a/setup/config/config_syncapi.go
+++ b/setup/config/config_syncapi.go
@@ -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)
}