Skip to content

Is it possible to disable Material's search plugin in favour of the one built-in to MkDocs? #8116

Answered by squidfunk
patrick-kidger asked this question in Q&A
Discussion options

You must be logged in to vote

I don't think MkDocs' search implementation will save you (if you're interested, here's a blog post on this topic). Have you tried tweaking the separator of the search plugin that is used for tokenization? It makes a big difference. For instance, the default is:

plugins:
  - search:
      separator: '[\s\-]+'

Interestingly, it doesn't even support multi-character separators (see blog post), so the + is actually a no-op. This is because of how lunr.js' tokenizer works, and why we completely replaced it. Now, here's the one we use for our docs:

plugins:
  - search:
      separator: '[\s\-,:!=\[\]()"/]+|(?!\b)(?=[A-Z][a-z])|\.(?!\d)|&[lg]t;'

I think with some experimentation you'll be able t…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@patrick-kidger
Comment options

@squidfunk
Comment options

Answer selected by patrick-kidger
@patrick-kidger
Comment options

@kamilkrzyskow
Comment options

@squidfunk
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants