Re: How can we use elasticsearch custom similarity plugin in mapping ?
Using the function_score you could use a script. Since 0.90.10 you can access term statistics from a script (https://github.com/elasticsearch/elasticsearch/issues/3772), term frequency included. You could for instance emit your own score that takes into account only the term frequency but not the idf. On Thursday, January 16, 2014 9:18:57 AM UTC+1, Jörg Prante wrote: I don't know how to do this by function score, but have you looked at it? Jörg -- You received this message because you are subscribed to the Google Groups elasticsearch group. To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/1db8d628--4150-a2bd-64fcd7839cd0%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: How can we use elasticsearch custom similarity plugin in mapping ?
Is there any java api available for function_score ? On Thu, Jan 16, 2014 at 5:16 PM, Luca Cavanna cavannal...@gmail.com wrote: Using the function_score you could use a script. Since 0.90.10 you can access term statistics from a script ( https://github.com/elasticsearch/elasticsearch/issues/3772), term frequency included. You could for instance emit your own score that takes into account only the term frequency but not the idf. On Thursday, January 16, 2014 9:18:57 AM UTC+1, Jörg Prante wrote: I don't know how to do this by function score, but have you looked at it? Jörg -- You received this message because you are subscribed to the Google Groups elasticsearch group. To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/1db8d628--4150-a2bd-64fcd7839cd0%40googlegroups.com . For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups elasticsearch group. To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAAVTvp6rZ3yrTL8RMTpzS78-W_GKb7Oj2nED7jTiTfWEzw9amg%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: How can we use elasticsearch custom similarity plugin in mapping ?
I tried using FunctionScoreQueryBuilders but there is no such thing available with me. Do I need to use any package for this ? On Thu, Jan 16, 2014 at 6:26 PM, Luca Cavanna cavannal...@gmail.com wrote: Not sure what you mean, the function score is a query that is part of the query DSL. If you are using the java API, you can find the usual query builder, called FunctionScoreQueryBuilder or even use the handy QueryBuilders static methods to create one. On Thu, Jan 16, 2014 at 1:43 PM, Mukul Gupta mukulnit...@gmail.comwrote: Is there any java api available for function_score ? On Thu, Jan 16, 2014 at 5:16 PM, Luca Cavanna cavannal...@gmail.comwrote: Using the function_score you could use a script. Since 0.90.10 you can access term statistics from a script ( https://github.com/elasticsearch/elasticsearch/issues/3772), term frequency included. You could for instance emit your own score that takes into account only the term frequency but not the idf. On Thursday, January 16, 2014 9:18:57 AM UTC+1, Jörg Prante wrote: I don't know how to do this by function score, but have you looked at it? Jörg -- You received this message because you are subscribed to the Google Groups elasticsearch group. To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/1db8d628--4150-a2bd-64fcd7839cd0%40googlegroups.com . For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to a topic in the Google Groups elasticsearch group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/elasticsearch/1tB6yB0m10o/unsubscribe. To unsubscribe from this group and all its topics, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAAVTvp6rZ3yrTL8RMTpzS78-W_GKb7Oj2nED7jTiTfWEzw9amg%40mail.gmail.com . For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups elasticsearch group. To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CADdZ9MWh0f49t5ek9aaKA5AeEgaJEsfwc4XAqaqB5Cbibc0vig%40mail.gmail.com . For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups elasticsearch group. To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAAVTvp7t6P16U0bb1DP0%2Bz%3DgS6dBjMfpCpbNw5WSmeXSHsYCHQ%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: How can we use elasticsearch custom similarity plugin in mapping ?
I guess you are using a not so recent version of elasticsearch then. Which version are you working on? On Thu, Jan 16, 2014 at 2:21 PM, Mukul Gupta mukulnit...@gmail.com wrote: I tried using FunctionScoreQueryBuilders but there is no such thing available with me. Do I need to use any package for this ? On Thu, Jan 16, 2014 at 6:26 PM, Luca Cavanna cavannal...@gmail.comwrote: Not sure what you mean, the function score is a query that is part of the query DSL. If you are using the java API, you can find the usual query builder, called FunctionScoreQueryBuilder or even use the handy QueryBuilders static methods to create one. On Thu, Jan 16, 2014 at 1:43 PM, Mukul Gupta mukulnit...@gmail.comwrote: Is there any java api available for function_score ? On Thu, Jan 16, 2014 at 5:16 PM, Luca Cavanna cavannal...@gmail.comwrote: Using the function_score you could use a script. Since 0.90.10 you can access term statistics from a script ( https://github.com/elasticsearch/elasticsearch/issues/3772), term frequency included. You could for instance emit your own score that takes into account only the term frequency but not the idf. On Thursday, January 16, 2014 9:18:57 AM UTC+1, Jörg Prante wrote: I don't know how to do this by function score, but have you looked at it? Jörg -- You received this message because you are subscribed to the Google Groups elasticsearch group. To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/1db8d628--4150-a2bd-64fcd7839cd0%40googlegroups.com . For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to a topic in the Google Groups elasticsearch group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/elasticsearch/1tB6yB0m10o/unsubscribe. To unsubscribe from this group and all its topics, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAAVTvp6rZ3yrTL8RMTpzS78-W_GKb7Oj2nED7jTiTfWEzw9amg%40mail.gmail.com . For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups elasticsearch group. To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CADdZ9MWh0f49t5ek9aaKA5AeEgaJEsfwc4XAqaqB5Cbibc0vig%40mail.gmail.com . For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to a topic in the Google Groups elasticsearch group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/elasticsearch/1tB6yB0m10o/unsubscribe. To unsubscribe from this group and all its topics, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAAVTvp7t6P16U0bb1DP0%2Bz%3DgS6dBjMfpCpbNw5WSmeXSHsYCHQ%40mail.gmail.com . For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups elasticsearch group. To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CADdZ9MVNbuqDw%3DDHbvzprLvhM%2BT-UWFQwaLm1bX-qsgTzVzf4Q%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: How can we use elasticsearch custom similarity plugin in mapping ?
My bad. I'm using elasticsearch-0.90.3. I guess it's not available in this version. On Thu, Jan 16, 2014 at 6:56 PM, Luca Cavanna cavannal...@gmail.com wrote: I guess you are using a not so recent version of elasticsearch then. Which version are you working on? On Thu, Jan 16, 2014 at 2:21 PM, Mukul Gupta mukulnit...@gmail.comwrote: I tried using FunctionScoreQueryBuilders but there is no such thing available with me. Do I need to use any package for this ? On Thu, Jan 16, 2014 at 6:26 PM, Luca Cavanna cavannal...@gmail.comwrote: Not sure what you mean, the function score is a query that is part of the query DSL. If you are using the java API, you can find the usual query builder, called FunctionScoreQueryBuilder or even use the handy QueryBuilders static methods to create one. On Thu, Jan 16, 2014 at 1:43 PM, Mukul Gupta mukulnit...@gmail.comwrote: Is there any java api available for function_score ? On Thu, Jan 16, 2014 at 5:16 PM, Luca Cavanna cavannal...@gmail.comwrote: Using the function_score you could use a script. Since 0.90.10 you can access term statistics from a script ( https://github.com/elasticsearch/elasticsearch/issues/3772), term frequency included. You could for instance emit your own score that takes into account only the term frequency but not the idf. On Thursday, January 16, 2014 9:18:57 AM UTC+1, Jörg Prante wrote: I don't know how to do this by function score, but have you looked at it? Jörg -- You received this message because you are subscribed to the Google Groups elasticsearch group. To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/1db8d628--4150-a2bd-64fcd7839cd0%40googlegroups.com . For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to a topic in the Google Groups elasticsearch group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/elasticsearch/1tB6yB0m10o/unsubscribe . To unsubscribe from this group and all its topics, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAAVTvp6rZ3yrTL8RMTpzS78-W_GKb7Oj2nED7jTiTfWEzw9amg%40mail.gmail.com . For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups elasticsearch group. To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CADdZ9MWh0f49t5ek9aaKA5AeEgaJEsfwc4XAqaqB5Cbibc0vig%40mail.gmail.com . For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to a topic in the Google Groups elasticsearch group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/elasticsearch/1tB6yB0m10o/unsubscribe. To unsubscribe from this group and all its topics, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAAVTvp7t6P16U0bb1DP0%2Bz%3DgS6dBjMfpCpbNw5WSmeXSHsYCHQ%40mail.gmail.com . For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups elasticsearch group. To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CADdZ9MVNbuqDw%3DDHbvzprLvhM%2BT-UWFQwaLm1bX-qsgTzVzf4Q%40mail.gmail.com . For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups elasticsearch group. To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAAVTvp5BFRsSr30hDEjr%3DPb0bFXiL2_iOvMxaEShNU-dc7xV5g%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: How can we use elasticsearch custom similarity plugin in mapping ?
The plugin is outdated. You can override similarity by standard ES 0.90+ http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/index-modules-similarity.html Jörg -- You received this message because you are subscribed to the Google Groups elasticsearch group. To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEMeNc4MpEO82L6KfLFsZziqdUO8F1LoRMgq3NrSyucqg%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: How can we use elasticsearch custom similarity plugin in mapping ?
I have read about that module but the thing is I have to set idf to 1. Actually, I want common terms to give more weight in my search. Now, when I googled about it, it says overriding the default similarity class is the only way to achieve it. That's the reason why I'm looking for these plugins. On Wed, Jan 15, 2014 at 10:35 PM, joergpra...@gmail.com joergpra...@gmail.com wrote: The plugin is outdated. You can override similarity by standard ES 0.90+ http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/index-modules-similarity.html Jörg -- You received this message because you are subscribed to the Google Groups elasticsearch group. To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEMeNc4MpEO82L6KfLFsZziqdUO8F1LoRMgq3NrSyucqg%40mail.gmail.com . For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups elasticsearch group. To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAAVTvp5vDnq7w4rkA7CWNJUNpHmG9ztYdiN5u%3D1tj-%3DjvJSMUQ%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: How can we use elasticsearch custom similarity plugin in mapping ?
Why don't you use function score if you only want to tweak parameters? http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html Changing similarity is a massive change, it's exchanging the whole algorithm. Not recommended unless you can't get what you want from function score. Jörg -- You received this message because you are subscribed to the Google Groups elasticsearch group. To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEOLeH_HhB4Lf9eg7OEtGK9w6Nk7vpoH9CU97D%2BSyRbig%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: How can we use elasticsearch custom similarity plugin in mapping ?
I was focused on how to use a custom similarity and not how to actually tackle the problem. In this respect, I agree with Jörg. Also, I believe the today's release (1.0.0.RC1) has additional scripting options: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-advanced-scripting.html Cheers, Ivan On Wed, Jan 15, 2014 at 10:53 AM, joergpra...@gmail.com joergpra...@gmail.com wrote: Why don't you use function score if you only want to tweak parameters? http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html Changing similarity is a massive change, it's exchanging the whole algorithm. Not recommended unless you can't get what you want from function score. Jörg -- You received this message because you are subscribed to the Google Groups elasticsearch group. To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEOLeH_HhB4Lf9eg7OEtGK9w6Nk7vpoH9CU97D%2BSyRbig%40mail.gmail.com . For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups elasticsearch group. To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQAiU2RK9vbpDxemDn15VbuKOV0ujCxGiuPNGVZxs-dC-g%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: How can we use elasticsearch custom similarity plugin in mapping ?
Hi Ivan, Can you please tell me how can I add the above mentioned classes in my elasticsearch classpath ? Thanks On Wed, Jan 15, 2014 at 11:22 PM, Ivan Brusic i...@brusic.com wrote: I have looked into that similarity plugin in the past and as far as I can tell, it is partially wrong. Judging by the elasticsearch code, there is no way to change the similarity depending if you are indexing or querying. The similarity is simply tied to a field and it is used at all times. Someone please correct me if I am wrong. Besides that, writing your own similarity plugin is simple. You just need one class extending AbstractSimilarityProvider and another class with the actual similarity, which probably extends DefaultSimilarity. No need for a plugin, you just need the classes in the elasticsearch classpath at startup. Cheers, Ivan On Wed, Jan 15, 2014 at 9:17 AM, Mukul Gupta mukulnit...@gmail.comwrote: I have read about that module but the thing is I have to set idf to 1. Actually, I want common terms to give more weight in my search. Now, when I googled about it, it says overriding the default similarity class is the only way to achieve it. That's the reason why I'm looking for these plugins. On Wed, Jan 15, 2014 at 10:35 PM, joergpra...@gmail.com joergpra...@gmail.com wrote: The plugin is outdated. You can override similarity by standard ES 0.90+ http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/index-modules-similarity.html Jörg -- You received this message because you are subscribed to the Google Groups elasticsearch group. To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEMeNc4MpEO82L6KfLFsZziqdUO8F1LoRMgq3NrSyucqg%40mail.gmail.com . For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups elasticsearch group. To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAAVTvp5vDnq7w4rkA7CWNJUNpHmG9ztYdiN5u%3D1tj-%3DjvJSMUQ%40mail.gmail.com . For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups elasticsearch group. To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQD8OXROhz4R1oMaL6TbcvjEhQdRh8sFvNpcxgc_2Y3VSA%40mail.gmail.com . For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups elasticsearch group. To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAAVTvp43PYoBfzThbQSMpDfn-VFz_KgHaT7whYC6msSD2%3DcQwQ%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: How can we use elasticsearch custom similarity plugin in mapping ?
Hi Jörg, Let's say I want to modify my _score in such a way that it doesn't take into consideration idf while calculating score. How can I achieve this using function score ? Can you give me some example usage of function score which takes only tf into consideration. Thanks On Thu, Jan 16, 2014 at 12:23 AM, joergpra...@gmail.com joergpra...@gmail.com wrote: Why don't you use function score if you only want to tweak parameters? http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html Changing similarity is a massive change, it's exchanging the whole algorithm. Not recommended unless you can't get what you want from function score. Jörg -- You received this message because you are subscribed to the Google Groups elasticsearch group. To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEOLeH_HhB4Lf9eg7OEtGK9w6Nk7vpoH9CU97D%2BSyRbig%40mail.gmail.com . For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups elasticsearch group. To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAAVTvp51QDJ2OBnhfPEEX6XWjOrh9E5k2f%3Dgg4xGx2qNJtM8GA%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.