Can Atlas gaussian score modifier accept arbitrary numeric inputs like log?

I’m looking for a way to get the gauss score of a constant value as part of a $search query.

I’ve found a workaround where you can define a dummy field in the search index that will never be populated like

{
  "dummy": {
    "type": "number"
  }
}

and then you pass that to your gauss function like

{
  "function": {
    "gauss": {
      "path": {
        "value": "dummy",
        "undefined": 1895
      },
      "origin": 295,
      "scale": 500
    }
  }
}

While this does work, it feels really hacky to do and I’m wondering if there’s a better, more “correct” way to do this.

Even better would be if I could feed the relevance score of a query into a gauss:

{
  "compound": {
    "must": [
      {
        "near": {
          "path": "fieldA",
          "origin": 0,
          "pivot": 20,
          "score": {
            "path": {
              "value": "fieldA"
            }
          }
        }
      },
      {
        "near": {
          "path": "fieldB",
          "origin": 0,
          "pivot": 20,
          "score": {
            "path": {
              "value": "fieldB"
            }
          }
        }
      }
    ],
    "score": {
      "function": {
        "gauss": {
          /* uses relevance score from this block */
        }
      }
    }
  }
}

which (in this case) is a really inelegant version of “add two numbers together and get the gauss of the sum” but this would also be a really nice thing to be able to do.

Can you provide us more information on what you seek to accomplish with this query?

What you describe, though I’m not completely sure I understood you correctly, sounds somewhat similar to how gauss works in Atlas Search. In the case of the first two must clauses, the contributions to the relevance score are added up. The gauss function will then impact the relevance score of those two docs from the point in the origin that you elect to pivot on and at the rate dictated by the decay function or gauss parameters.

For more actionable assistance, please provide:

  1. A sample document (can be mostly or all fake data)
  2. The index definition
  3. A bit more about the use case
  4. What was the reason for gauss. I’m not intending to suggest it is wrong, but I am thinking of values to suggest to you.

Thanks for the question! I feel it bear a fruitful discussion.

Have you explored log and log1p?