Skip to content

feat(tantivy): add advanced search features#2805

Merged
yujonglee merged 2 commits intomainfrom
devin/1767531460-tantivy-advanced-features
Jan 4, 2026
Merged

feat(tantivy): add advanced search features#2805
yujonglee merged 2 commits intomainfrom
devin/1767531460-tantivy-advanced-features

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Jan 4, 2026

feat(tantivy): add advanced search features

Summary

Adds three Tantivy-specific search features to the plugins/tantivy plugin that go beyond basic full-text search:

  1. Snippet/Highlighting support - Uses Tantivy's SnippetGenerator to return highlighted text fragments showing exactly where query terms matched. Enable via options.snippets: true in search requests.

  2. Phrase search (PhraseQuery) - Quoted searches like "action items" now use PhraseQuery for exact phrase matching. Configurable slop via options.phrase_slop.

  3. Faceted search - Added facets field to documents and facet filter to search. Facets use Tantivy's hierarchical facet system (e.g., /tags/important, /participants/john).

Updates since last revision

  • Removed MoreLikeThisQuery feature and all related code as requested

Review & Testing Checklist for Human

  • Schema migration: Verify existing search indexes work after this change. The new facets field is added to the schema - test that old documents without facets can still be read correctly.
  • Phrase parsing edge cases: Test quoted search with unbalanced quotes, empty phrases (""), and phrases with special characters.
  • Frontend compatibility: The TypeScript types changed - SearchHit now includes title_snippet/content_snippet (nullable), SearchDocument has facets. Verify consuming code handles these.

Recommended test plan:

  1. Run the desktop app and perform searches to verify basic search still works
  2. Test a quoted phrase search like "meeting notes"
  3. Enable snippets in a search and verify highlighted fragments are returned
  4. Index a document with facets and filter by facet

Notes

  • All existing tests pass
  • TypeScript bindings regenerated via cargo test
  • No new tests added for the new features - manual testing recommended

Link to Devin run: https://app.devin.ai/sessions/f02b6b597f154e59abbed7ff8e78dcde
Requested by: yujonglee (@yujonglee)

- Add snippet/highlighting support with SnippetGenerator
- Add phrase search (PhraseQuery) support for quoted searches
- Add faceted search with facet field and filtering
- Add MoreLikeThisQuery for finding similar meetings
- Update TypeScript bindings with new types

Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@netlify
Copy link

netlify bot commented Jan 4, 2026

Deploy Preview for hyprnote canceled.

Name Link
🔨 Latest commit 2ae14fc
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/695a64be0b6bdb0009371d3b

@netlify
Copy link

netlify bot commented Jan 4, 2026

Deploy Preview for howto-fix-macos-audio-selection canceled.

Name Link
🔨 Latest commit 2ae14fc
🔍 Latest deploy log https://app.netlify.com/projects/howto-fix-macos-audio-selection/deploys/695a64bee5d1300008efcc88

@netlify
Copy link

netlify bot commented Jan 4, 2026

Deploy Preview for hyprnote-storybook canceled.

Name Link
🔨 Latest commit 2ae14fc
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/695a64be7c126800072d1b33

Remove MoreLikeThisQuery and all related code as requested:
- Remove MoreLikeThisOptions and MoreLikeThisRequest types from lib.rs
- Remove more_like_this command from commands.rs
- Remove more_like_this method from ext.rs
- Remove MoreLikeThisQuery import from ext.rs
- Regenerate TypeScript bindings

Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
@yujonglee yujonglee merged commit dd0ba68 into main Jan 4, 2026
18 of 20 checks passed
@yujonglee yujonglee deleted the devin/1767531460-tantivy-advanced-features branch January 4, 2026 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant