leo-buneev / vuepress-plugin-fulltext-search

Adds full-text search capabilities to your vuepress site with a help of flexsearch library.
MIT License
93 stars 23 forks source link

Search should be work on Internationalized sites #27

Open hamishwillee opened 3 years ago

hamishwillee commented 3 years ago

The default Vuepress search plugin is aware that you're in a multilingual site, and searches only the current language. As this is now I get the same doc in all translations where there is any common text.

EDIT: Note, I could be incorrect here - the default-header only search may simply not show the translations because most headings are translated. Either way it is a flaw - as a user I am would probably only be interested in matching translations as a "last resort"

hamishwillee commented 3 years ago

Hi @leo-buneev Is there any way I can feed the current language of the page being displayed into the plugin? Further, on the home page, if one is displayed, it should/could just use English.

pbek commented 3 years ago

vuepress-plugin-fulltext-search is great! But unfortunately I've the same issue when trying to use it on https://www.qownnotes.org/. The whole page, including all translations, is searched when I enter something in the search bar.

hamishwillee commented 3 years ago

The way this is done in the default search is here: https://github.com/vuejs/vuepress/blob/38e98634af117f83b6a32c8ff42488d91b66f663/packages/%40vuepress/plugin-search/SearchBox.vue#L86