-
Notifications
You must be signed in to change notification settings - Fork 17
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
feat: Upgrade search #2079
Conversation
8d8c64e
to
406203d
Compare
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. |
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. |
0f726f1
to
01cda28
Compare
9892d01
to
fb9ce12
Compare
3ef60f6
to
db0ffdd
Compare
I've tested this in the benchmark and it adds about 1% to the solve rate. So, good to merge. |
db0ffdd
to
b97c3c6
Compare
Also drop unused dependencies
b97c3c6
to
9006278
Compare
🎉 This PR is included in version @appland/search-v1.0.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
🎉 This PR is included in version @appland/appmap-v3.173.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
TODO
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:
weight=3
weight=2
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.