This PR lets us store fields in the index so we can ship a single file and have it be usable in a frontend application.
We add initial support for storing String fields directly in the MultiIndex.
The fields are stored in a Map[String, Array[String]] where the map keys are the field names, and the Arrays are all the field values. This means they're sort of stored in a columnar fashion.
A new search method, searchMap is added which returns a (Int, Map[String, String]) for each resulting document.
Where the Int is the doc ID, and the Map[String, String] is all the fields for that document.
This interface isn't great but it feels "good enough for now".
JsInterop has been updated to leverage this and some tweaks to the UI have been made:
This PR lets us store fields in the index so we can ship a single file and have it be usable in a frontend application.
We add initial support for storing
String
fields directly in theMultiIndex
. The fields are stored in aMap[String, Array[String]]
where the map keys are the field names, and the Arrays are all the field values. This means they're sort of stored in a columnar fashion.A new search method,
searchMap
is added which returns a(Int, Map[String, String])
for each resulting document. Where theInt
is the doc ID, and theMap[String, String]
is all the fields for that document. This interface isn't great but it feels "good enough for now".JsInterop has been updated to leverage this and some tweaks to the UI have been made:![Screenshot 2023-12-27 at 09-58-07 JS Interop Search](https://github.com/cozydev-pink/protosearch/assets/5440389/d786fab1-c6d1-43f2-a010-cd9bc996f691)
Resolves https://github.com/cozydev-pink/protosearch/issues/154