Rank Feature vs. Decay

Hi,
I'm trying rank feature for a rank field, and comparing the results to a function score using a gauss decay function on a similarly-valued float field. The results are pre-filtered with a geo_distance query in both cases.
I've tried changing parameters for both the query and the function, but no matter what I do, I get the following:
The 9th and 10th result for rank_feature are switched in the order of rank, as opposed to function score which gets them "right".
What am I missing?

function score query:

{
  "query": {
    "function_score": {
      "functions": [

        {
          "gauss": {
            "rank": {
              "origin": "1.176285743713379",
              "scale": "0.52"
            }
          }
        }
      ],
      "boost_mode": "replace", 
      "query": {
            "bool": {
      "filter": {
        "geo_distance": {
          "distance": "1km",
          "startPoint": {
            "lat": 32.0691,
            "lon": 34.818733
          }
        }
      }
            }
        
      }
    }
  },
    "_source": [
      "rank"
    ]
}

rank_feature query:

{
  "track_total_hits": false,
      "query": {
        "bool": {
          "filter": {
            "geo_distance": {
              "distance": "1000m",
              "startPoint": {
                "lat": 32.0691,
                "lon": 34.818733
              }
            }
          },
          "should": [
            
            {
        "rank_feature": {
          "field": "rank_feature"
        }
            }
          ]
        }
      },
    "_source": [
      "rank"
    ]
}

rank_feature results (notice the last two at the bottom when scrolling down):

  {
    "_source" : {
      "rank" : 0.5111902543796677
    }
  },
  {
    "_source" : {
      "rank" : 0.5
    }
  },
  {
    "_source" : {
      "rank" : 0.46628138522373463
    }
  },
  {
    "_source" : {
      "rank" : 0.4417490478510222
    }
  },
  {
    "_source" : {
      "rank" : 0.4376207403170089
    }
  },
  {
    "_source" : {
      "rank" : 0.4357255666844616
    }
  },
  {
    "_source" : {
      "rank" : 0.43511569723807253
    }
  },
  {
    "_source" : {
      "rank" : 0.4336625204125677
    }
  },
  {
    "_source" : {
      "rank" : 0.43122650407429886
    }
  },
  {
    "_source" : {
      "rank" : 0.43133425965676375
    }
  }

Thanks,
Shai

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.