cmfcmf / docusaurus-search-local

Offline / Local Search for Docusaurus v2. Try it live at:
https://cmfcmf.github.io/OpenWeatherMap-PHP-API/
MIT License
446 stars 67 forks source link

Override the separator #20

Closed micael-atos closed 3 years ago

micael-atos commented 3 years ago

For now, lunr consider '-' to be a separator. I can't find the string 'foo-bar' in the search. It's possible to change the way the index is built by changing the separator:

lunr.tokenizer.separator = /\s+/;

See lunr's commit here

Could we add an option in the configuration to override this property?

cmfcmf commented 3 years ago

Good point! The commit you referenced also was a very helpful read. I added a new plugin option to configure the separator in version 0.5.0 :tada: