Hi Dmarin, Did you consider using http://wiki.apache.org/solr/QueryElevationComponent ?
________________________________ From: Jack Krupansky <j...@basetechnology.com> To: solr-user@lucene.apache.org Sent: Wednesday, July 17, 2013 12:53 AM Subject: Re: Searching w/explicit Multi-Word Synonym Expansion In case you were unaware, generalized multi-word synonym expansion is an unsolved problem in Lucene/Solr. Sure, some of the tools are there and you can sometimes make it work for some situations, but not for the general case. Some work has been in progress, but no near-term solution is at hand. -- Jack Krupansky -----Original Message----- From: dmarini Sent: Tuesday, July 16, 2013 5:23 PM To: solr-user@lucene.apache.org Subject: Searching w/explicit Multi-Word Synonym Expansion Hi Everyone, I'm using Solr (version 4.3) for the first time and through much research I got into writing a custom search handler using edismax to do relevancy searches. Of course, the client I'm preparing the search for also has synonyms (both bidirectional and explicit). After much research, I have managed to get the bidirectional synonyms to work, but we have one scenario that isn't behaving as expected. To simplify the example, imagine that my collection has 2 fields: Sku: String Title String Using CopyFields, I copy these to 2 more fields, SkuSearch and TitleSearch which have a type that corresponds to the following field type in the schema file: As you can see, the bidirectional synonyms (ones that look like the following: ipod, i-pod, iPod) are expanded and stored in the index (the synonyms.txt file) as per the best practices from the wiki. One unique thing I've seen is that we have a bunch of shortcut terms where a user wants to type in "lp" and it will bring up one of 5 skus. So I created a shortcuts.txt file that has only the explicit synonym mappings (like so: lp => 12345, 98765, 11010). My thought to including only these in the query analyzer portion is that since explicit synonyms are not expanded (since the sku values are already indexed in the field as they should be) and the expand=true is useless for explicit synonyms (based on my reading), I can just use the explicit synonym expand the query term to it's mapped skus and just find documents containing them, but it's not working like it does in my head :) I'll paste my handler below, here's the issue. for use cases like the one above it's working. It's when I have an entry in shortcuts.txt that looks like this: (hot dog => 12345, 67890, 10232) that I don't get anything back if I put in hot dog but I do get results when I use "hot dog" with quotes. Is there any way to get the results without quotes? am I doing something wrong altogether? are there any other suggestions? my search handler looks as follows: Thanks for any help that can be offered. --Dave -- View this message in context: http://lucene.472066.n3.nabble.com/Searching-w-explicit-Multi-Word-Synonym-Expansion-tp4078469.html Sent from the Solr - User mailing list archive at Nabble.com.