feat(tantivy): implement full-text search plugin as Orama replacement #2769
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
feat(tantivy): implement full-text search plugin as Orama replacement
Summary
This PR implements the
plugins/tantivyplugin with full-text search functionality using Tantivy 0.22, preparing it as a future replacement for the Orama-based search system. This is preparation work only - the plugin is not yet integrated into the desktop app.Key additions:
id,doc_type,title,content,created_atadd_document,update_document,delete_document,commitsearch(query parser) andsearch_fuzzy(fuzzy term matching)created_atrange queries (gte, lte, gt, lt, eq)tokio::sync::MutexReview & Testing Checklist for Human
id,doc_type,title,content,created_at) matches what the current Orama search indexes. Thedoc_typefield expects values like "session", "human", "organization"schemabefore getting mutablewriteraccess (lines 59-66 in ext.rs) - verify this pattern doesn't introduce race conditions{app_data}/search_index- confirm this is the appropriate location and won't conflict with other dataRecommended Test Plan
init()to create the indexadd_document()andcommit()search()andsearch_fuzzy()return expected resultscreated_atfiltering with various operatorsNotes
build_created_at_range_queryfunction has an unused_fieldparameter with hardcoded field name - intentional simplification but worth notingLink to Devin run: https://app.devin.ai/sessions/5a14afbb59c9484b849f67a4a15d3652
Requested by: yujonglee (@yujonglee)