Hello,

Do you mean that you want searches for "gain" to match documents with
"revenue" on them, but do *not* want searches for "revenue" to match
documents with "gain" on them?

If that's what you mean, how have you defined your synonyms? If you're
using the SynonymGraphFilterFactory
https://lucene.apache.org/core/8_6_0/analyzers-common/org/apache/lucene/analysis/synonym/SynonymGraphFilterFactory.html
then the default parser is
https://lucene.apache.org/core/8_6_0/analyzers-common/org/apache/lucene/analysis/synonym/SolrSynonymParser.html
which by default will treat comma separated entries as equivalent
(bi-directional), while an explicit mapping (=>) only goes in one direction.

e.g. given "revenue,gain", revenue is a synonym of gain and gain is a
synonym of revenue. However given "gain => revenue", revenue will be a
synonym of gain (If you search for gain it will match revenue, but revenue
won't turn into gain).
When using the synonymGraphFilter at query time I believe (though this may
be wrong) that for directional mappings I needed to include the term from
the left hand side on the right hand side as well in order for it to still
match the original term.
So if I've understood your question, I would define that as "gain =>
gain,revenue".

If that doesn't solve it, feel free to share your config and someone might
be able to make a suggestion

On Fri, 22 Jan 2021 at 14:11, Iram Tariq <iram.ta...@northbaysolutions.net>
wrote:

> Hi All,
>
> Using SOLR default Synonyms search I am able to search Synonyms but for
> some cases it is giving ambiguous results.
>
> For example one of Synonyms of "Revenue" is "Gain"
> Input Keyword for search: Revenue and Company
> Irrelevant Output: Our company doesn't want to gain success through
> shortcuts.
> Solr version I am using: 8.6.3
>
> Any help is very much appreciated here.
>
> Regards,
>
>
> Iram Tariq | Associate Architect
>
> NorthBay
>
> Direct:  +92-333-3636333
>
> iram.ta...@northbaysolutions.net
>
> www.northbaysolutions.com
>

Reply via email to