Function_score

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Function_score

paul
What should be defined inside the function , any example queries. could not find one on elastic search page.this throws a exception  No query registered for [function_score]]
{
   "query":{
      "function_score":{
         "query":{
            "match":{
               "programs":"computer science"
            }
         },
         "functions":[
            {
               "filter":{
                  "range":{
                     "tution":{
                        "from":10000,
                        "to":20000
                     }
                  }
               },
               "FUNCTION":{
"boost": "3"
               }
            }
         ],
         "score_mode":"avg",
         "boost_mode":"avg"
      }
   }
}

--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: Function_score

Alexander Reelsen-2
Hey,


So either script_score, boost factor, random or one of the decay functions.. the error message is also telling you not to forget the query field inside of the function score.


--Alex


On Fri, Nov 22, 2013 at 9:31 AM, paul <[hidden email]> wrote:
What should be defined inside the function , any example queries. could not find one on elastic search page.this throws a exception  No query registered for [function_score]]
{
   "query":{
      "function_score":{
         "query":{
            "match":{
               "programs":"computer science"
            }
         },
         "functions":[
            {
               "filter":{
                  "range":{
                     "tution":{
                        "from":10000,
                        "to":20000
                     }
                  }
               },
               "FUNCTION":{
"boost": "3"
               }
            }
         ],
         "score_mode":"avg",
         "boost_mode":"avg"
      }
   }
}

--
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 [hidden email].
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: Function_score

paul
thank you , will try them.


On Fri, Nov 22, 2013 at 2:04 PM, Alexander Reelsen <[hidden email]> wrote:
Hey,


So either script_score, boost factor, random or one of the decay functions.. the error message is also telling you not to forget the query field inside of the function score.


--Alex


On Fri, Nov 22, 2013 at 9:31 AM, paul <[hidden email]> wrote:
What should be defined inside the function , any example queries. could not find one on elastic search page.this throws a exception  No query registered for [function_score]]
{
   "query":{
      "function_score":{
         "query":{
            "match":{
               "programs":"computer science"
            }
         },
         "functions":[
            {
               "filter":{
                  "range":{
                     "tution":{
                        "from":10000,
                        "to":20000
                     }
                  }
               },
               "FUNCTION":{
"boost": "3"
               }
            }
         ],
         "score_mode":"avg",
         "boost_mode":"avg"
      }
   }
}

--
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 [hidden email].

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/ZGjv6eCBKXs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: Function_score

paul
In reply to this post by Alexander Reelsen-2
hi Alex i tried as suggested but it seams i am still missing something , when i tried the query below i still get No query registered for [function_score]] exception


{
  "query": {
    "function_score": {
      "functions": [
        {
          "DECAY_FUNCTION": {
            "Tution": {
              "reference": "10000",
              "scale": "5000"
            }
          }
        }
      ],
      "query": {
        "match": {
          "programs": "computer science"
        }
      },
      "score_mode": "multiply"
    }
  }
}

On Friday, 22 November 2013 14:04:49 UTC+5:30, Alexander Reelsen wrote:
Hey,


So either script_score, boost factor, random or one of the decay functions.. the error message is also telling you not to forget the query field inside of the function score.


--Alex


On Fri, Nov 22, 2013 at 9:31 AM, paul <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="JFypSa7LBU0J">avinas...@...> wrote:
What should be defined inside the function , any example queries. could not find one on elastic search page.this throws a exception  No query registered for [function_score]]
{
   "query":{
      "function_score":{
         "query":{
            "match":{
               "programs":"computer science"
            }
         },
         "functions":[
            {
               "filter":{
                  "range":{
                     "tution":{
                        "from":10000,
                        "to":20000
                     }
                  }
               },
               "FUNCTION":{
"boost": "3"
               }
            }
         ],
         "score_mode":"avg",
         "boost_mode":"avg"
      }
   }
}

--
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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="JFypSa7LBU0J">elasticsearc...@googlegroups.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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: Function_score

William Goldstein
Hey I realize this is an old thread, but just in case anyone else has this problem, it's almost definitely a versioning issue... updating to 0.90.10 solved it for me.  

I think I got an older version by using `brew install`, but download/installation directly from the website is super easy: http://www.elasticsearch.org/download/



On Friday, November 22, 2013 4:37:40 AM UTC-5, paul wrote:
hi Alex i tried as suggested but it seams i am still missing something , when i tried the query below i still get No query registered for [function_score]] exception


{
  "query": {
    "function_score": {
      "functions": [
        {
          "DECAY_FUNCTION": {
            "Tution": {
              "reference": "10000",
              "scale": "5000"
            }
          }
        }
      ],
      "query": {
        "match": {
          "programs": "computer science"
        }
      },
      "score_mode": "multiply"
    }
  }
}

On Friday, 22 November 2013 14:04:49 UTC+5:30, Alexander Reelsen wrote:
Hey,

you need to use one of the score functions mentioned in <a href="http://www.google.com/url?q=http%3A%2F%2Fwww.elasticsearch.org%2Fguide%2Fen%2Felasticsearch%2Freference%2Fcurrent%2Fquery-dsl-function-score-query.html%23_score_functions&amp;sa=D&amp;sntz=1&amp;usg=AFQjCNFBAPkmuOAra99m7KO_A6OltCBZoQ" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.elasticsearch.org%2Fguide%2Fen%2Felasticsearch%2Freference%2Fcurrent%2Fquery-dsl-function-score-query.html%23_score_functions\46sa\75D\46sntz\0751\46usg\75AFQjCNFBAPkmuOAra99m7KO_A6OltCBZoQ';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.elasticsearch.org%2Fguide%2Fen%2Felasticsearch%2Freference%2Fcurrent%2Fquery-dsl-function-score-query.html%23_score_functions\46sa\75D\46sntz\0751\46usg\75AFQjCNFBAPkmuOAra99m7KO_A6OltCBZoQ';return true;">http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html#_score_functions

So either script_score, boost factor, random or one of the decay functions.. the error message is also telling you not to forget the query field inside of the function score.


--Alex


On Fri, Nov 22, 2013 at 9:31 AM, paul <[hidden email]> wrote:
What should be defined inside the function , any example queries. could not find one on elastic search page.this throws a exception  No query registered for [function_score]]
{
   "query":{
      "function_score":{
         "query":{
            "match":{
               "programs":"computer science"
            }
         },
         "functions":[
            {
               "filter":{
                  "range":{
                     "tution":{
                        "from":10000,
                        "to":20000
                     }
                  }
               },
               "FUNCTION":{
"boost": "3"
               }
            }
         ],
         "score_mode":"avg",
         "boost_mode":"avg"
      }
   }
}

--
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 elasticsearc...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/groups/opt_out" target="_blank" onmousedown="this.href='https://groups.google.com/groups/opt_out';return true;" onclick="this.href='https://groups.google.com/groups/opt_out';return true;">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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/69eb1edd-ab2a-47d6-92dd-cb20e6b70116%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: Function_score

paul
thank you william will try upgrading

-paul


On Tue, Jan 14, 2014 at 4:23 AM, William Goldstein <[hidden email]> wrote:
Hey I realize this is an old thread, but just in case anyone else has this problem, it's almost definitely a versioning issue... updating to 0.90.10 solved it for me.  

I think I got an older version by using `brew install`, but download/installation directly from the website is super easy: http://www.elasticsearch.org/download/



On Friday, November 22, 2013 4:37:40 AM UTC-5, paul wrote:
hi Alex i tried as suggested but it seams i am still missing something , when i tried the query below i still get No query registered for [function_score]] exception


{
  "query": {
    "function_score": {
      "functions": [
        {
          "DECAY_FUNCTION": {
            "Tution": {
              "reference": "10000",
              "scale": "5000"
            }
          }
        }
      ],
      "query": {
        "match": {
          "programs": "computer science"
        }
      },
      "score_mode": "multiply"
    }
  }
}

On Friday, 22 November 2013 14:04:49 UTC+5:30, Alexander Reelsen wrote:
Hey,


So either script_score, boost factor, random or one of the decay functions.. the error message is also telling you not to forget the query field inside of the function score.


--Alex


On Fri, Nov 22, 2013 at 9:31 AM, paul <[hidden email]> wrote:
What should be defined inside the function , any example queries. could not find one on elastic search page.this throws a exception  No query registered for [function_score]]
{
   "query":{
      "function_score":{
         "query":{
            "match":{
               "programs":"computer science"
            }
         },
         "functions":[
            {
               "filter":{
                  "range":{
                     "tution":{
                        "from":10000,
                        "to":20000
                     }
                  }
               },
               "FUNCTION":{
"boost": "3"
               }
            }
         ],
         "score_mode":"avg",
         "boost_mode":"avg"
      }
   }
}

--
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 elasticsearc...@googlegroups.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/ZGjv6eCBKXs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/69eb1edd-ab2a-47d6-92dd-cb20e6b70116%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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAO066G0iRsSxqQPtfJ2j4sJHM7uVS2yb9bK-dHgv5dQDWNLxig%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.