diff options
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; +} |