-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Add full profile search #763
Conversation
This wasn't really working correctly - the stop word 'work' would leave instances of 'working' and 'works' in the index for example.
- Search for terms in AND mode, per https://lunrjs.com/guides/searching.html#term-presence - Discard non-alphanumeric characters from the search - Better handling of contractions and searching for stop words
This reverts commit f6384c9.
Previously, searching for e.g. "don't" wasn't working correctly. After trimming the contraction, "do" is a stop word, so it should be ignored.
@dougaitken I guess I need to fix the bot before this is merged, otherwise it will probably keep causing problems later on. Please do try out the search though, it's ready to play with at https://deploy-preview-763--remote-jobs.netlify.app/ I also see "Loading search data... Infinity%" when this is hosted on Netlify. I'll fix that in this PR too. |
This probably doesn't matter right now due to the way the scripts are currently structured, but it might matter one day and it's more logical this way.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
2 similar comments
This comment has been minimized.
This comment has been minimized.
🤖 Sorry, this bot is currently having issues. It's probably @nylen's fault, not yours. We'll look into it. 🤖 |
When a Node.js error occurs the exit code is probably going to be 1, so we should use a different code.
0567cc1
to
9e84e21
Compare
OK, this is all good from my end. |
This was wrong (out of date), but the correct version is obvious from reading the code.
Flipping 'eck. This is incredible. Are you using offline workers or something for the search? I can't break it so let's do this. I think for #464 and #569 we could maybe add things like |
Glad you like it, I had fun building it.
It's using https://lunrjs.com/ which if I remember correctly is the same library that Calypso devdocs uses. The new code here uses Lunr to generate an index of all the data every time the site gets built. The index is just a different way to organize the data so that it can be searched quickly - basically a map of all the words that appear in our data and where they can be found. Then when you start searching on the site, it downloads the latest index data and the actual searching happens in your browser using that index.
Good thing to look into for a future enhancement. This already works pretty well though - if you search for "react" then you're going to get all the companies that use React. |
This pull request modifies the "filter" box on the list homepage to search through all company profile data.
You can read more about how the search works here: https://blog.remoteintech.company/search-help/ This page is also linked from the "More info" text at the search box.
_incomplete
as mentioned in the search documentation)Screenshot
Try it first!
You can try this before it's merged by going here: https://deploy-preview-763--remote-jobs.netlify.app/ Please let me know if you see any issues.