Hi Laurent

Laurent Gilles wrote:
> 
> Hi,
> 
> I was faced with the same issues reguarding multiwords synonyms
> Let's say a synonyms list like:
> 
> club, bar, night cabaret
> 
> Now if we have a document containing "club", with the default synonyms
> filter behaviour with expand=true, we will end up in the lucene index with
> a
> document containing "club|bar|night cabaret".
> So if the user search for "night", the query-time will search for "night"
> in
> the index and will match our document since it had been "enriched" @
> index-time, and it really contains the token "night".
> 
> The only valid solution I've founded was to create a field-type
> exclusively
> used for synonyms search where: 
> 
> @IndexTime
> <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
> ignoreCase="true" expand="false" />
> @QueryTime
> <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
> ignoreCase="true" expand="false" />
> 
> And with a customised synonyms file that looks like:
> 
> SYN_ID_1, club, bar, night cabaret
> 
> So for our document containing "club", the synonym filter at index time
> with
> expand=false will replace every matching token/expression in the document
> with the SYN_ID_1.
> 
> And at query time, when an user search for "night", since "night" is not
> alone in synonyms definition, it will not be matched, even by "normal"
> search, because every document containing "club" or "bar" would have been
> "enriched" with "SYN_ID_1" and NOT with "club|bar|night cabaret", so the
> final indexed document will not contains isolated token from synonyms
> expression that risks to be matched later without notice.
> 
> In order to match our document containing "club", the user HAVE TO type
> the
> entire expression "night cabaret", and not only part of the expression.
> 
> 
> Of course, as I said before, this field was exclusively used for synonym
> matching, so it requires another field for normal full-text-stemmed search
> to add normal results, this approach give us the opportunity to setup
> Boosting separately on full-text-stemmed search VS synonyms search, let's
> say :
> 
> "title_stem":"club"^100 OR "title_syns":"club"^10
> 
> I hope to have been clear, even if I don’t believe to.. Fact is this
> approach have fixed your problem, since we didn't what synonym matching if
> the user only types part of synonymic expression.
> 
> Regards,
> Laurent
> 
> 

This has seemed to solve our problem. Thank you very much for your help. 
Once we have our environment setup and all of our data indexed, it may even
provide an extra 'bonus' to be able to add different weights/boosts for the
different fields.

Now, not to be too greedy, but I am wondering if there is a way to utilize
this technique for "Explicit synonym matching" (i.e. synonym mappings that
use the '=>' operator).  For example, we may have a couple mappings like the
following:
night club=>club, bar
swim club=>club, team

As you can see, both night clubs and swim clubs are clubs, but are not
necessarily equivalent with the term "club".  It would be nice to be able to
search for "night club" and only see results for "clubs" and "bars", but not
necessarily "teams", which otherwise, would show up in the results if we use
Equivalent synonyms.

Just wondering if you have been able to do this as well.

Again, thank you for your help!

-- 
View this message in context: 
http://www.nabble.com/solr-synonyms-behaviour-tp15051211p18703520.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to