Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
With the "apache solr search module" you could add synonyms into the synonyms.txt that solr ships with.
So when you search for "old" or "aged" you get the same results with both.
Comments
Comment #1
drunken monkeyYes, you can do that.
If you are asking to put a default synonyms.txt into the module file: I don't think that will happen. I try to keep this more or less generic, so a stopwords file just suited for English sites (and also maybe for just a certain type of sites) wouldn't be appropriate here.
Comment #2
marcoka CreditAttribution: marcoka commentedno i am not asking to put a synonyms file in the module. i am asking if search api uses the synonyms.txt in the solr config dir /solr/drupal/solr/config
Comment #3
drunken monkeyNo, it doesn't. For that to work you'll have to remove the comments around the two
solr.SynonymFilterFactory
filter definitions in the "text" type.However, when we don't ship with synonyms (same for stopwords, …) I really think we should leave that commented out. People will have to customize to some degree anyways, and when they want to use such advanced features they should know how to handle this. We could include additional comments in the schema.xml explaining this, though. Or maybe others will show up in favor of this and we'll include the filters after all. Don't know exactly how much of a performance loss this would be for people not using synonyms/stopwords.
Comment #4
marcoka CreditAttribution: marcoka commentedi think as always i dont clearly describe. i am able to configure solr and know about various options in the xml.
Stuff like this:
http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#solr.Synonym...
What i meant to ask is if, if i configure that synonym stuff right, will search api handle it correctly. I know that it only routs through solr and it should work, but wanted to ask instead of guessing :)
Comment #5
drunken monkeyAh, OK, thanks for clarifying!
Yes, everything should work fine, even highlighting. Otherwise, please file a bug report.