Articles by Peter Bengtsson
-
How MDN’s autocomplete search works
Last month, Gregor Weber and Peter Bengtsson added an autocomplete search to MDN Web Docs, that allows you to quickly jump straight to the document you're looking for by typing parts of the document title. This is the story about how that's implemented.
-
How MDN’s site-search works
Periodically, the whole of MDN is built, by our Node code , in a GitHub Action. A Python script bulk-publishes this to Elasticsearch. Our Django server queries the same Elasticsearch via /api/v1/search. The site-search page is a static single-page app that sends XHR requests to the /api/v1/search endpoint. Search results' sort-order is determined by match and "popularity".