Faceted Search conflicts with the Porter/Stemmer module
will_in_wi - August 24, 2008 - 22:50
| Project: | Faceted Search |
| Version: | 5.x-1.0-beta4 |
| Component: | Code |
| Category: | bug report |
| Priority: | minor |
| Assigned: | Unassigned |
| Status: | active |
Description
If you use the porter/stemmer module with the keyword search, a search such as symphony will show up in the interface as symphoni.
I think this is due to using the wrong field to display.

#1
Good catch. I just tested it and same here. I searched for "economy" and the results were returned as "economi". I use latest versions of faceted search (5.x-1.0-beta 4) and porter stemmer (5.x-1.0).
#2
If you perform the same search with Drupal's core search, do you get different results from Faceted Search's?
#3
David, this really has to do with the header of the faceted search results page and the current search term listing - the search results themselves are OK. Please see the attached screenshots.
#4
#5
I am encountering the same problem in Drupal 6.x. Economy becomes economi
Can you please suggest a work around or why the same problem is occurring. I'd like to find a way to work around it / solve the "bug".
#6
I get the same thing. Presumably the porter/stemmer changes the search string from oranges to orang. That is removes plurals. On the standard search you don't see this as the standard search title does not include the search string. The URL still looks to be correct so perhaps a work-around would be to theme the search results page and replace the title with something extracted from the URL or just replace it with search like standard search page does.
As far as I can see the title is set in facet_search_ui.module at line 716 on. I've commented out line 723 and replaced it with
$labels[] = check_plain($env->_text);
which just makes the title "search : ". whatever-you-typed
That seems a reasonable result although the code is a bit untidy.
UPDATE: two words, i.e. oranges lemons comes out as search oranges lemons, oranges lemons. Not sure why.
I'm running 6.1.x-beta2 so this issue affects 6 as well
#7
This also affect the current search block as well as the search title. The problem is in facted_search.module line 372 $words = search_simplify($match[2]);. The function search_simplify as well as making lower case etc. also calls search_invoke_preprocess which is what invokes porterstemmer. In some respects the stemmer is called at the wrong time. It perhaps should be called just before the search takes place, on each key.
#8
Thanks a lot, malc_b & will_in_wi.
It was creeping me out that -seemingly randomly- titles got cropped or changed on search result pages.
Really helped me out.
#9
@wentsch Did you manage to find a solution for the problem then? Can you post instructions please?
#10
@niccottrell: sorry,haven't been around here for a while. I simply commented out line 723, as malc_b suggested.