Skip to content

[8.15] Fix Synthetic Source Handling for bit Type in dense_vector Field (#114407)#114759

Merged
elasticsearchmachine merged 9 commits intoelastic:8.15from
benwtrent:backport/8.15/pr-114407
Oct 15, 2024
Merged

[8.15] Fix Synthetic Source Handling for bit Type in dense_vector Field (#114407)#114759
elasticsearchmachine merged 9 commits intoelastic:8.15from
benwtrent:backport/8.15/pr-114407

Conversation

@benwtrent
Copy link
Copy Markdown
Member

Backport

This will backport the following commits from main to 8.15:

Questions ?

Please refer to the Backport tool documentation

…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)

(cherry picked from commit 465c65c)
@benwtrent benwtrent added auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) >bug :Search Relevance/Vectors Vector search v8.15.4 labels Oct 14, 2024
@benwtrent benwtrent changed the title [8.15] Fix Synthetic Source Handling for `bit` Type in `dense_vector` Field (#114407) [8.15] Fix Synthetic Source Handling for bit Type in dense_vector Field (#114407) Oct 14, 2024
@elasticsearchmachine elasticsearchmachine merged commit f8386c3 into elastic:8.15 Oct 15, 2024
@benwtrent benwtrent deleted the backport/8.15/pr-114407 branch October 15, 2024 19:42
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/Vectors Vector search v8.15.4

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants