Skip to content

Conversation

@mayya-sharipova
Copy link
Contributor

Backports the following commits to 8.x:

Currently if a document has duplicate suggestions across different
contexts, only the first gets indexed, and when a user tries to
search using the second context, she will get 0 results.

This PR addresses this, but adding support for duplicate suggestions
across different contexts, so documents like below with duplicate inputs
can be searched across all provided contexts.

```json
{
  "my_suggest": [
    {
      "input": [
        "foox",
        "boo"
      ],
      "weight" : 2,
      "contexts": {
        "color": [
          "red"
        ]
      }
    },
    {
      "input": [
        "foox"
      ],
      "weight" : 3,
      "contexts": {
        "color": [
         "blue"
        ]
      }
    }
  ]
}
```

Closes elastic#82432
@mayya-sharipova mayya-sharipova added :Search Relevance/Suggesters "Did you mean" and suggestions as you type >bug auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch labels Jan 31, 2025
@elasticsearchmachine elasticsearchmachine merged commit 18b5fe8 into elastic:8.x Jan 31, 2025
15 checks passed
@mayya-sharipova mayya-sharipova deleted the backport/8.x/pr-121324 branch January 31, 2025 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport >bug :Search Relevance/Suggesters "Did you mean" and suggestions as you type Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch v8.19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants