RFC: improve showMatchesPosition
#787
flevi29
started this conversation in
Feedback & Feature Proposal
Replies: 1 comment
-
Hi @flevi29 , thank you for your willingness to help us improve Meilisearch ❤️ We'll happily accept your contribution to improve the feature, let us know if you have any questions or need a review. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
showMatchesPosition
is closely related to highlights, and it could be a better alternative. As of right now it doesn't respectsearchableAttributes
,attributesToHighlight
,attributesToRetrieve
,attributesToCrop
,cropLength
, but it could very well support all of these.In fact
showMatchesPosition
, when enabled, should entirely replace_formatted
, which should not be computed at all, this would further speed up Meilisearch, offloading the task of string manipulation to the frontend. If you're usingshowMatchesPosition
, my thinking is that you're not touching_formatted
either way.Also, as far as I'm aware current implementation doesn't escape highlight tags, so there's always a slight chance that this could cause issues, but I haven't fully confirmed this just yet.
Also highlights are meant to be interpreted as HTML, so modern frameworks do a lot of work to sanitize it. This means that we could increase both backend and frontend performance with this.
I have previously worked on highlights (meilisearch/meilisearch#4928), I would like to attempt to make this RFC a reality as well, if I know there is interest from the Meilisearch team.
Beta Was this translation helpful? Give feedback.
All reactions