Closed lfdebrux closed 3 years ago
This'll be due to the way that stemming rules are applied to the different 'versions' of the search term as the user types – we disabled stemming in the Design System search for this exact reason (https://github.com/alphagov/govuk-design-system/commit/531d3c3c0e564c35891026df49712d0e480c5337).
Suspect this issue might makes more sense on the alphagov/tech-docs-gem repo as it'll affect all tech docs instances?
Oh interesting, I didn't realise search was shared behaviour, thanks @36degrees I will share there
Thanks for transferring @36degrees
It looks like search pipeline is configured in govuk_tech_docs.rb
, using middleman-search
https://github.com/alphagov/tech-docs-gem/blob/master/lib/govuk_tech_docs.rb#L106-L118
middleman-search
is based on LunrJS so the fix from Design System might still work, I am happy to investigate.
I can reproduce with the example in this repo by searching for documentatio
/ documentation
So fixing the behaviour is very straightforward; I am just trying to work it how to write tests for it!
What I'm trying to do
Search for "reliability engineering"
What I expect to happen
As I type the word "reliability" the number of results decreases steadily to only those pages containing the word "reliability"
What actually happens
I type "reliab", I get 10 results.
I type "reliabi", or "reliabil", or "reliabili", or "reliabilit", I get 0 results.
I type "reliability", I get 10 results.
I've attached a screen recording of this happening.
https://user-images.githubusercontent.com/503614/112124302-1c4e3f00-8bba-11eb-9090-99ddbe236f1a.mp4