You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all: ❤️ Thank you so much for this awesome project! I am loving it. I evaluate it to migrate my sphinx based documentation for my side project HomeGallery to rspress and I gain good progress.
What bugs me is the search result. While rspress uses FlexSearch which comes with create great text search capabilities #matchResultItem skips fuzzy matches by searching the query as query phrase using LocalSearch provider only. E.g. I have a title Extractor Plugin but for the query 'plugin extractor' I receive empty search results. This is very bad for technical documentation site because search terms are spread over the document content and a user should find at least some matches.
By inspecting the code:
constnormalizedTitle=normalizeTextCase(title);if(normalizedTitle.includes(query)){// return match}else{// remove this match}
in #matchContent only a phrase search match produces a hit.
When having only the local search provider, #matchContent skips the fuzzy search and returns an empty list while FlexSearch provided results:
if(queryIndex===-1){// In case fuzzy search// We get the matched content position from server responseconsthighlightItems=(itemasRemotePageInfo)._matchesPosition?.content;if(!highlightItems?.length){return;}
...
}
At the end, PageSearcher.match(keyword, limit) does not offer to hook into the raw result of the search provider (FlexSearch) by returning only the post processed and empty matchResult. Then in SearchPanel.tsx the onSearch hook receives only the filtered result.
So my question is: How can I enable fuzzy search with the FlexSearch as LocalSearch provider so that rspress find matches when the user flips terms? Is this fuzzy search for local provider NIY or not provided on purpose?
For me it would be OK to pass the raw provider result to the onSearch hook so that a custom implementations can post process the result of the provider.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
First of all: ❤️ Thank you so much for this awesome project! I am loving it. I evaluate it to migrate my sphinx based documentation for my side project HomeGallery to rspress and I gain good progress.
What bugs me is the search result. While rspress uses FlexSearch which comes with create great text search capabilities #matchResultItem skips fuzzy matches by searching the query as query phrase using LocalSearch provider only. E.g. I have a title Extractor Plugin but for the query 'plugin extractor' I receive empty search results. This is very bad for technical documentation site because search terms are spread over the document content and a user should find at least some matches.
By inspecting the code:
in #matchTitle or
in #matchContent only a phrase search match produces a hit.
When having only the local search provider, #matchContent skips the fuzzy search and returns an empty list while FlexSearch provided results:
At the end,
PageSearcher.match(keyword, limit)does not offer to hook into the raw result of the search provider (FlexSearch) by returning only the post processed and emptymatchResult. Then in SearchPanel.tsx theonSearchhook receives only the filtered result.So my question is: How can I enable fuzzy search with the FlexSearch as LocalSearch provider so that rspress find matches when the user flips terms? Is this fuzzy search for local provider NIY or not provided on purpose?
For me it would be OK to pass the raw provider result to the
onSearchhook so that a custom implementations can post process the result of the provider.RFC
Beta Was this translation helpful? Give feedback.
All reactions