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

removeDefaultStemmer option does not seems to work #396

Open
tmax22 opened this issue Feb 8, 2024 · 4 comments
Open

removeDefaultStemmer option does not seems to work #396

tmax22 opened this issue Feb 8, 2024 · 4 comments

Comments

@tmax22
Copy link

tmax22 commented Feb 8, 2024

// docusaurus.config.ts
  themes: [
    [
      require.resolve("@easyops-cn/docusaurus-search-local"),
      /** @type {import("@easyops-cn/docusaurus-search-local").PluginOptions} */
      {
      
        hashed: true,
        highlightSearchTermsOnTargetPage: true,
        removeDefaultStemmer: true,
        removeDefaultStopWordFilter: true,
      },
    ],
  ],

i enabled removeDefaultStemmer but i still cannot search for partiel word terms (for example search for utomatio and not automation

@msykes
Copy link

msykes commented May 27, 2024

I'm having the same issue. Partial searches aren't working for me.

I've tried rebuilding, emptying caches on browser and reloading, no difference. hashed false/true doesn't make a difference.

@weareoutman
Copy link
Member

Currently this is not supported. Under the hood, only trailing wildcard is used, which means keywords like autom will match automation, while utomatio will not.

@msykes
Copy link

msykes commented Jun 3, 2024

thanks for the reply, for me the behaviour is the same if it's set to true or false then, for example, if I type auto then automation would be found regardless of that setting... is that normal?

At the same time, something like #_T won't find #_TEST, that was what I was hoping to achieve with this setting, thinking maybe e search starting with #_ is the problem and TESTwould partially match, any suggestions/feedback there is appreciated!

@weareoutman
Copy link
Member

What a Stemmer do is that:

reducing inflected (or sometimes derived) words to their word stem, base or root

Such as converting automation / automate to the same root autom.

So enable removeDefaultStemmer will disable that conversion.

But whether enable removeDefaultStemmer or not will not affect the result of typing auto to match automation, because in both config it matches the trailing wildcard pattern.

For your question about #_TEST, this word will be stored as a token as it is, which is #_TEST, because by default the English tokenizer only splits on whitespace and hyphens. And currently we have no options for that customization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants