-
Notifications
You must be signed in to change notification settings - Fork 63
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: Orama search #162
base: master
Are you sure you want to change the base?
feat: Orama search #162
Conversation
|
Rather than doing our own sort of the search results after they're returned, let's do it all within the search library. I got it working pretty well in this StackBlitz demo, so you should just be able to copy it: https://stackblitz.com/edit/stackblitz-starters-8wuzli?file=index.js Here's the code for reference:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! I just put a comment.
}, | ||
components: { | ||
tokenizer: { language: 'english', stemming: false } | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the code uses a custom sort. So, the default sorting can be turned off, speeding up the insertion time and performance.
https://docs.oramasearch.com/usage/search/sorting#disable-sort
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aha!! good idea
I tried using ur concept. It feels the same, but now everything under Types sections is gone. Im looking into how to get em back CleanShot.2023-06-30.at.17.21.57.mp4 |
// console.log(search_results); | ||
// console.log(results); | ||
|
||
const results = tree([], blocks).children; | ||
console.log(buildBlockTree(blocks)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should remove these few lines
const blocks = []; | ||
|
||
for (const result of search_results) { | ||
// @ts-ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this @ts-ignore
needed? it doesn't look like it would be, but if so, then perhaps it should be @ts-expect-error
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. just a few minor comments
I just tried searching |
Hi @benmccann, can we help in any way to get this PR go through? |
No description provided.