In order to fix the excerpt problem, that is where search can't find an excerpt matching the search (due to the search being the stemmed value), can I suggest that you provide a function that returns just the root. So for likely, like, liking all of which return a search key of like the common root function would return lik, or lik.*? which matches all the possible keys. That would enable search excerpt to work will a simple patch to call this function.

Looking at the code I think this could just be a copy of stem functions and then change all the replaces to replace with ''. Would that work?

Comments

jhodgdon’s picture

You can use the Stem() function in Porter Stemmer to return the root of a word. That is exactly what it does. For the word "liking", "like" is the grammatical root.

Anyway, I have a fix for the underlying problem with search excerpts now, see #493270: search_excerpt() doesn't work well with stemming

greggles’s picture

Category: feature » support
Status: Active » Fixed

Since this is already provided, I guess this can be considered a support request and considered fixed.

Thanks @jhodgdon.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.