Closed vladsud closed 3 years ago
Last updated: 09/23/20
The primary purpose of the search task is to enable the Fluid Framework runtime to offer text extraction and cataloguing that is more robust than what is available by default to the developer. Currently, if a developer, for example, wanted to design a custom search indexer that could keep up to date with changes to DataObject(s) over time (or any similar system that relies on polling for a specific class of changes over time), then they would need to rely on raw op log processing or resort to other inscrutable tricks. If we add a capability that lets a DataObject periodically (i.e. on every snapshot) update an easily accessible "blob" of information, then this task becomes much easier. Furthermore, the solution for "search" could be generalized for a whole class of "augmentation" tasks that need to periodically poll for information that may or may not be text.
There are essentially two components to search:
Blob
on the MergeTreedataStoreRuntime.ts
's snapshotInternal()
method, add a task that invokes a DataObject's callback to check if there is any search text to be appended to the snapshot tree.datasStoreRuntime
for invoking callbacks to the DataObject.
FluidDataStoreRuntime
class to register a callback to a DataObject and keep a private reference to it, to be invoked later during snapshotInternal()
.All search work (except of GC) is done, so closing this issue. @ksbrar - you probably want to close you PR. I've added similar functionality through mixins, and while some small code is in our repo, most of the code (the knowledge about search contract) is in Bohemia repo
Expose a way for components to provide a way to supply alternative ".search" blobs as part of generating component snapshot, such that components have ability to provide searchable stream for service to index