Discussion:
An example for creating SynonymMap Object?
b***@oracle.com
2018-10-15 18:52:33 UTC
Permalink
Hi,-

 is there any example on Lucene domain for creating SynonymMap Object?

Best regards


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-***@lucene.apache.org
For additional commands, e-mail: java-user-***@lucene.apache.org
Markus Jelsma
2018-10-15 19:28:50 UTC
Permalink
Hello Baris,

Check out the filter factory and the map parser for a more low level example:

https://github.com/apache/lucene-solr/blob/master/lucene/analysis/common/src/java/org/apache/lucene/analysis/synonym/SynonymGraphFilterFactory.java
https://github.com/apache/lucene-solr/blob/master/lucene/analysis/common/src/java/org/apache/lucene/analysis/synonym/SynonymMap.java



-----Original message-----
Sent: Monday 15th October 2018 20:52
Subject: An example for creating SynonymMap Object?
Hi,-
 is there any example on Lucene domain for creating SynonymMap Object?
Best regards
---------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-***@lucene.apache.org
For additional commands, e-mail: java-user-***@lucene.apache.org
b***@oracle.com
2018-10-15 21:02:58 UTC
Permalink
Thanks Markus.

i am trying to see whether i need to add abc-> 123 and also 123-> abc
via builder.add.

Best regards
Post by Markus Jelsma
Hello Baris,
https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_apache_lucene-2Dsolr_blob_master_lucene_analysis_common_src_java_org_apache_lucene_analysis_synonym_SynonymGraphFilterFactory.java&d=DwIFaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=nlG5z5NcNdIbQAiX-BKNeyLlULCbaezrgocEvPhQkl4&m=WfZ3QMUdvaRJKSSAOkVSI2ud96gdsfnb6_5W_s66ADc&s=gjKepGZ0VZN-2J6s7QgQZs7xeg5qbDwZ8a5soocXnhs&e=
https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_apache_lucene-2Dsolr_blob_master_lucene_analysis_common_src_java_org_apache_lucene_analysis_synonym_SynonymMap.java&d=DwIFaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=nlG5z5NcNdIbQAiX-BKNeyLlULCbaezrgocEvPhQkl4&m=WfZ3QMUdvaRJKSSAOkVSI2ud96gdsfnb6_5W_s66ADc&s=ZFSdd4OtF4v3cg7Y5dQV81y82Xt9XvLv-FDYwDbviKo&e=
-----Original message-----
Sent: Monday 15th October 2018 20:52
Subject: An example for creating SynonymMap Object?
Hi,-
 is there any example on Lucene domain for creating SynonymMap Object?
Best regards
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-***@lucene.apache.org
For additional commands, e-mail: java-user-***@lucene.apache.org
Markus Jelsma
2018-10-15 22:30:56 UTC
Permalink
Hello Baris,

The expand parameter defaults to true, so you should not have to add both rules. If you are using Solr, you can easily check it in the analysis tab. If not, printing the resulting Query object works as well.

Regards,
Markus



-----Original message-----
Sent: Monday 15th October 2018 23:03
Subject: Re: An example for creating SynonymMap Object?
Thanks Markus.
i am trying to see whether i need to add abc-> 123 and also 123-> abc
via builder.add.
Best regards
Post by Markus Jelsma
Hello Baris,
https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_apache_lucene-2Dsolr_blob_master_lucene_analysis_common_src_java_org_apache_lucene_analysis_synonym_SynonymGraphFilterFactory.java&d=DwIFaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=nlG5z5NcNdIbQAiX-BKNeyLlULCbaezrgocEvPhQkl4&m=WfZ3QMUdvaRJKSSAOkVSI2ud96gdsfnb6_5W_s66ADc&s=gjKepGZ0VZN-2J6s7QgQZs7xeg5qbDwZ8a5soocXnhs&e=
https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_apache_lucene-2Dsolr_blob_master_lucene_analysis_common_src_java_org_apache_lucene_analysis_synonym_SynonymMap.java&d=DwIFaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=nlG5z5NcNdIbQAiX-BKNeyLlULCbaezrgocEvPhQkl4&m=WfZ3QMUdvaRJKSSAOkVSI2ud96gdsfnb6_5W_s66ADc&s=ZFSdd4OtF4v3cg7Y5dQV81y82Xt9XvLv-FDYwDbviKo&e=
  
  
-----Original message-----
Sent: Monday 15th October 2018 20:52
Subject: An example for creating SynonymMap Object?
Hi,-
    is there any example on Lucene domain for creating SynonymMap Object?
Best regards
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-***@lucene.apache.org
For additional commands, e-mail: java-user-***@lucene.apache.org
baris.kazar
2018-10-15 22:50:55 UTC
Permalink
Well, query object is defined for searcher and synonyms are handled at index time.
This is not with solr.

i will not add both but then
123 or abc will mean abc or 123
even one mapping is defined then, right?

Best
Post by Markus Jelsma
Hello Baris,
The expand parameter defaults to true, so you should not have to add both rules. If you are using Solr, you can easily check it in the analysis tab. If not, printing the resulting Query object works as well.
Regards,
Markus
-----Original message-----
Sent: Monday 15th October 2018 23:03
Subject: Re: An example for creating SynonymMap Object?
Thanks Markus.
i am trying to see whether i need to add abc-> 123 and also 123-> abc
via builder.add.
Best regards
Post by Markus Jelsma
Hello Baris,
https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_apache_lucene-2Dsolr_blob_master_lucene_analysis_common_src_java_org_apache_lucene_analysis_synonym_SynonymGraphFilterFactory.java&d=DwIFaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=nlG5z5NcNdIbQAiX-BKNeyLlULCbaezrgocEvPhQkl4&m=WfZ3QMUdvaRJKSSAOkVSI2ud96gdsfnb6_5W_s66ADc&s=gjKepGZ0VZN-2J6s7QgQZs7xeg5qbDwZ8a5soocXnhs&e=
https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_apache_lucene-2Dsolr_blob_master_lucene_analysis_common_src_java_org_apache_lucene_analysis_synonym_SynonymMap.java&d=DwIFaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=nlG5z5NcNdIbQAiX-BKNeyLlULCbaezrgocEvPhQkl4&m=WfZ3QMUdvaRJKSSAOkVSI2ud96gdsfnb6_5W_s66ADc&s=ZFSdd4OtF4v3cg7Y5dQV81y82Xt9XvLv-FDYwDbviKo&e=
-----Original message-----
Sent: Monday 15th October 2018 20:52
Subject: An example for creating SynonymMap Object?
Hi,-
is there any example on Lucene domain for creating SynonymMap Object?
Best regards
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-***@lucene.apache.org
For additional commands, e-mail: java-user-***@lucene.apache.org
Loading...