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

How to boost site-search/autocomplete #49

Closed
peterbe opened this issue Jul 15, 2019 · 3 comments · Fixed by #234
Closed

How to boost site-search/autocomplete #49

peterbe opened this issue Jul 15, 2019 · 3 comments · Fixed by #234
Assignees

Comments

@peterbe
Copy link
Contributor

peterbe commented Jul 15, 2019

We don't have a search yet but I have a prototype for an autocomplete widget that can be used to navigate by typing in parts of the title. A flaw with this is that when the search input is small, there's no good way to decide which page to show first. For example "fo" should probably should probably present JavaScript/Reference/Global_Objects/Array/forEach ahead of Web/API/MediaKeyStatusMap/forEach because the latter is so much more popular.

@peterbe
Copy link
Contributor Author

peterbe commented Jul 15, 2019

One solution to boost is to use Google Analytics and some scripting. A cron job could download all the relative popularity of pages, by URI, and then when we build the titles.json file we inject the score there. Only Mozilla MDN will have this information available so if/when we build something like this we need to make it so it's optional for local development. Or at least easy to mock/fake.

@peterbe
Copy link
Contributor Author

peterbe commented Nov 14, 2019

If you want to play along, here's a titles.json file with 14,808 titles: https://www.peterbe.com/stumptown-renderer/issue-49/without-popularity/titles.json

Here's the same file but with not just a string but with a popularity: https://www.peterbe.com/stumptown-renderer/issue-49/with-popularity/titles.json

@peterbe peterbe self-assigned this Nov 14, 2019
@peterbe
Copy link
Contributor Author

peterbe commented Nov 14, 2019

I have a working solution for this. It's early stages but it seems very promising.

peterbe added a commit to peterbe/yari that referenced this issue Nov 15, 2019
peterbe added a commit to peterbe/yari that referenced this issue Nov 21, 2019
peterbe added a commit that referenced this issue Nov 21, 2019
* search with popularity

Fixes #49
Fixes #231

* finishing touches

* fix tests

* feedbacked

* remove console.log
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 a pull request may close this issue.

1 participant