Skip to content

[8.x] Fix Synthetic Source Handling for bit Type in dense_vector Field (#114407)#114756

Merged
elasticsearchmachine merged 1 commit intoelastic:8.xfrom
benwtrent:backport/8.x/pr-114407
Oct 14, 2024
Merged

[8.x] Fix Synthetic Source Handling for bit Type in dense_vector Field (#114407)#114756
elasticsearchmachine merged 1 commit intoelastic:8.xfrom
benwtrent:backport/8.x/pr-114407

Conversation

@benwtrent
Copy link
Copy Markdown
Member

Backports the following commits to 8.x:

…lastic#114407)

**Description:**

This PR addresses the issue described in [elastic#114402](elastic#114402), where the `synthetic_source` feature does not correctly handle the `bit` type in `dense_vector` fields when `index` is set to `false`. The root cause of the issue was that the `bit` type was not properly accounted for, leading to an array that is 8 times the size of the actual `dims` value of docvalue. This mismatch will causes an array out-of-bounds exception when reconstructing the document.

**Changes:**

- Adjusted the `synthetic_source` logic to correctly handle the `bit` type by ensuring the array size accounts for the 8x difference in dimensions.
- Added yaml test to cover the `bit` type scenario in `dense_vector` fields with `index` set to `false`.

**Related Issues:**

- Closes [elastic#114402](elastic#114402)
- Introduced in [elastic#110059](elastic#110059)
@benwtrent benwtrent added :Search Relevance/Vectors Vector search >bug auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport external-contributor Pull request authored by a developer outside the Elasticsearch team Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch labels Oct 14, 2024
@elasticsearchmachine elasticsearchmachine merged commit a5e0226 into elastic:8.x Oct 14, 2024
@benwtrent benwtrent deleted the backport/8.x/pr-114407 branch October 14, 2024 20:10
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 external-contributor Pull request authored by a developer outside the Elasticsearch team :Search Relevance/Vectors Vector search Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch v8.16.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants