jump to search:/  select search:K  navigate results:/  navigate suggestions:/  close suggestions:esc

    changes 2023-07-10

    tags: Lunr.js
    July 10th, 2023
    • Added:
    • Changes to dynamic results (via Lunr.js)
      • As the user goes from an almost complete term, to finishing it (i.e. as they move from typing the term [weblink] to adding the s for [weblinks]), the result quality deteriorated: the Shared weblinks page drops out of the autocomplete. The dynamic results performed worse than the actual SERP. The problem seems to be the implementation of the Lunr.js wildcard (to support dynamic updating as the user types their query): var results = idx.search(searchTerm + '*'); A search for [weblinks*] does not match the term weblinks. It appears to only match pages with links to the Shared weblinks page. The current solution will take advantage of the implicit OR in Lunr.js queries: var results = idx.search(searchTerm + '* ' + searchTerm);
        • This has the added benefit of supporting stemming (not supported with wildcards).
      • Searching [posts] had the [type:posts] hand-curated query at the top, hard-coded, rather than providing Posts as a top result. I modified the code that combines the hand-curated queries and the dynamic results to prioritize exact URL or title matches (slugified).
    Today's new posts