diff options
author | Gio <sethg@ipi.org> | 2024-03-26 20:08:52 -0500 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2024-05-31 12:11:45 -0300 |
commit | c364e42237493bf8985da23fdc394df735fe6c3f (patch) | |
tree | eed0a569dcdb7731a8f804ded8fc41ee75c3d5e3 /src/util | |
parent | fcc45e386df65c68969391c7b113b6232c76c82a (diff) |
search, upd8: share schema between client and upd8 code
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/searchSchema.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/util/searchSchema.js b/src/util/searchSchema.js new file mode 100644 index 00000000..99ba869a --- /dev/null +++ b/src/util/searchSchema.js @@ -0,0 +1,22 @@ +// Index structures shared by client and server. + +export function makeSearchIndexes(FlexSearch) { + const indexes = { + albums: new FlexSearch.Document({ + id: "reference", + index: ["name", "groups"], + }), + + tracks: new FlexSearch.Document({ + id: "reference", + index: ["name", "album", "artists", "directory", "additionalNames"], + }), + + artists: new FlexSearch.Document({ + id: "reference", + index: ["names"], + }), + }; + + return indexes; +} |