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

word separators in searching #867

Closed
randy3k opened this Issue Mar 15, 2016 · 2 comments

Comments

Projects
3 participants
@randy3k

randy3k commented Mar 15, 2016

Suppose in the markdown file, I have a "word": "Foo.bar", the current search function is not able to pick "Foo.bar" if I search for "bar". May be some settings in lunr.js will do the job?

@waylan

This comment has been minimized.

Member

waylan commented Mar 31, 2016

It appears that you would need to override lunr.tokenizer.seperator. As the code currently stands this change would be made in search.js which you could override using theme_dir (place a modified copy of search.js in the appropriate subdir). However, if this proposed fix to #869 is accepted, then index creation will be hardcoded into the Python source and no longer overridable by theme customization.

As I've been playing with search the last few days, I'm thinking we may need to add some search related config settings. One for this issue (word separators) and one for language support (see #826). Possibly even one to disable search support altogether?

@d0ugal d0ugal modified the milestone: 0.16 Apr 27, 2016

@waylan

This comment has been minimized.

Member

waylan commented May 25, 2016

I'm switching the milestone for this issue to 1.0 as this would be part of the search refactor which I'm working on for 1.0 (see my previous comment).

@waylan waylan modified the milestones: 0.16, 1.0.0 May 25, 2016

@waylan waylan self-assigned this Dec 2, 2016

@waylan waylan added this to To Do in Refactor search. May 2, 2017

@waylan waylan added the Plugin label Nov 1, 2017

waylan added a commit to waylan/mkdocs that referenced this issue Feb 1, 2018

Add seperator config option to search.
In mkdocs.yml define seperator like this:

  plugins:
      - search:
          seperator: '[\\s\\-\\.]+'

Fixes mkdocs#867.

@waylan waylan moved this from To Do to In Progress in Refactor search. Feb 1, 2018

waylan added a commit to waylan/mkdocs that referenced this issue Feb 2, 2018

Add seperator config option to search.
In mkdocs.yml define seperator like this:

  plugins:
      - search:
          seperator: '[\\s\\-\\.]+'

Fixes mkdocs#867.

waylan added a commit to waylan/mkdocs that referenced this issue Feb 2, 2018

Add seperator config option to search.
In mkdocs.yml define seperator like this:

  plugins:
      - search:
          seperator: '[\\s\\-\\.]+'

Fixes mkdocs#867.

waylan added a commit to waylan/mkdocs that referenced this issue Feb 27, 2018

Add seperator config option to search.
In mkdocs.yml define seperator like this:

  plugins:
      - search:
          seperator: '[\\s\\-\\.]+'

Fixes mkdocs#867.

@waylan waylan closed this in #1418 Mar 6, 2018

Refactor search. automation moved this from In Progress to Done Mar 6, 2018

waylan added a commit that referenced this issue Mar 6, 2018

Refactor search plugin (#1418)
* Use a web worker in the browser with a fallback (fixes #859 & closes #1396).
* Optionally pre-build search index (fixes #859 & closes #1061).
* Upgrade to lunr.js 2.x (fixes #1319).
* Support search in languages other than English (fixes #826).
* Allow the user to define the word separators (fixes #867).
* Only run searches for queries of length > 2 (fixes #1127).
* Remove dependency on require.js, mustache, etc. (fixes #1218).
* Compress the search index (fixes #1128).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment