Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Upgrade search #2079

Merged
merged 7 commits into from
Nov 5, 2024
Merged

feat: Upgrade search #2079

merged 7 commits into from
Nov 5, 2024

Conversation

kgilpin
Copy link
Contributor

@kgilpin kgilpin commented Oct 21, 2024

TODO

  • Ensure that include/exclude filters are being applied properly.

Full-text search is refactored out into its own package, @appland/search. In addition, the search functionality is upgraded and improved in a couple of different ways. Aside from these improvements, the code is generally moved over from @appland/appmap.

Inclusion of all document words

All document words are now included in the index. This is an upgrade from current behavior with source code files, in which only the file path and recognized symbols are indexed.

Symbols are detected in the same ways as with the current behavior. Then, the document is split into words. Each word that is already recognized as a symbol is removed from the word list, so that it's not double-counted.

Weighted terms

Each source file index entry includes three separate columns, which are essentially:

  • File path: weight=3
  • Symbols: weight=2
  • Words: weight=1

SQLite query syntax makes it possible to perform a weighted search over the file path, symbols, and words.

Boost factors

Each document can also be associated with a row in the boost factors table. This feature makes it possible to boost search results based on external factors. The intended usage for this feature is to boost the source files and snippets that appear in AppMap trace data files. Boost can also be applied based on other external factors, such as presence of a file in a relevant log entry, backtrace, or APM data file (to name three examples).

Search exports

@appland/search exports functions and constants that can be used externally to perform a search. Most optional behavior is controlled by passing in a function that matches a particular type signature. Concrete implementations of these functions are provided, but not assigned by default.

@kgilpin kgilpin self-assigned this Oct 21, 2024
@kgilpin kgilpin added the enhancement New feature or request label Oct 21, 2024
@dustinbyrne
Copy link
Contributor

Looking good, and I'm glad to see search getting its own package 👍. I've had similar thoughts about pulling out the local/remote Navie clients.

@kgilpin
Copy link
Contributor Author

kgilpin commented Oct 22, 2024

Cool; I was wondering how you’d feel about that. The CLI package is so crowded.

It does add overhead to update versions for release though.

@kgilpin
Copy link
Contributor Author

kgilpin commented Oct 28, 2024

I've tested this in the benchmark and it adds about 1% to the solve rate. So, good to merge.

@kgilpin kgilpin marked this pull request as draft October 28, 2024 13:16
@kgilpin kgilpin marked this pull request as ready for review November 5, 2024 19:46
@kgilpin kgilpin merged commit 6200072 into main Nov 5, 2024
23 checks passed
@appland-release
Copy link
Contributor

🎉 This PR is included in version @appland/search-v1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@appland-release
Copy link
Contributor

🎉 This PR is included in version @appland/appmap-v3.173.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants