Closed (fixed)
Project:
Search API Solr
Version:
7.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
9 Feb 2011 at 10:26 UTC
Updated:
24 Feb 2011 at 18:30 UTC
If I have two nodes, "Chair" and "Chairs", a search for Chair only results finding the first node. It would be nice with an option to show results that contains the keyword, rather than only exact keyword matches.
Comments
Comment #1
drunken monkeyThat specific problem can easily be solved by adding a stemmer to Solr's workflow — just uncommenting and, optionally, customizing the line containing the
solr.SnowballPorterFilterFactoryfilter tag will do the trick. This is just commented by default because the module should ship in a more or less language-independent state.Other language-dependent filters (like stopwords and synonyms) are also available — just read the comment above the "text" type definition (starting at line 157).
A general fuzzy search might be useful too, though. If this would still have a use case for you, please say so and (especially, if others agree) I'll see what I can do. An additional option for Solr servers would be the easiest solution, but that wouldn't allow for using fuzzy searches only in certain cases (e.g. for the search page, but not a search view).
You yourself could, as an easy workaround, implement
hook_search_api_solr_query_alter()to add this behaviour to keywords yourself. Or replace the Solr service class with a subclass, if this feels easier for you.Comment #2
JockeL commentedYes this works great, thanks!
So far a general fuzzy search would be enough for all my cases in need of faceted search, as long as there will be an option to choose language for the stemmer.
Maybe it would be enough to add a section of useful and commonly needed alterations of the Solr configuration to the documentation? Or a list of useful links to the solr wiki to point the user in the right direction for common needed features.
Comment #3
drunken monkeyOh, I thought something like this was already in README.txt … Seems I was wrong, so yes, I'll add this. Thanks for the suggestion.
The things one can changed are described in comments in the XML files anyway, but usually a user won't read them, I guess.
Comment #4
drunken monkeyOK, it was previously documented in INSTALL.txt, that's why I didn't find it. I now moved it to README.txt and also expanded it a little to mention stemming and the comments in the config files.