Skip to content

fix(elasticsearch): support fieldMultiValueLeniency for array columns - #723

Open
nktnet1 wants to merge 2 commits into
libredb:mainfrom
nktnet1:fix-elasticsearch-array-leniency
Open

fix(elasticsearch): support fieldMultiValueLeniency for array columns#723
nktnet1 wants to merge 2 commits into
libredb:mainfrom
nktnet1:fix-elasticsearch-array-leniency

Conversation

@nktnet1

@nktnet1 nktnet1 commented Sep 9, 2026

Copy link
Copy Markdown

Description

Enable fieldMultiValueLeniency.

Note that with this option enabled, for array fields, only one value is returned. This is a limitation outlined here:

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test addition or update

Related Issue

Resolves #722

Changes Made

  • enable fieldMultiValueLeniency

Testing

  • I have tested this locally
  • I have added/updated tests
  • All existing tests pass (for elastic search)

Test Environment

  • LibreDB Studio Version: 0.15.0
  • Browser: Zen
  • OS: MacOS
  • Node.js/Bun Version: Bun v1.0
  • Database Type: Elastic Search

Checklist

  • My code follows the project's code style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

@nktnet1
nktnet1 marked this pull request as ready for review September 9, 2026 05:16
@nktnet1
nktnet1 force-pushed the fix-elasticsearch-array-leniency branch from a4f2b84 to 7cb5115 Compare September 9, 2026 05:17
@cevheri cevheri assigned nktnet1 and cevheri and unassigned nktnet1 Sep 9, 2026
@cevheri cevheri added the loop:needs-moderator-action Flagged by the maintainer loop: suspicious content or a decision only a human can make label Sep 9, 2026
@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@cevheri cevheri assigned nktnet1 and unassigned cevheri Sep 9, 2026
@cevheri
cevheri self-requested a review September 9, 2026 11:47
@cevheri

cevheri commented Sep 9, 2026

Copy link
Copy Markdown
Member

Verified against the pinned images, not just the fixtures, and it holds. On Elasticsearch 9.1.4 SELECT tags FROM arrprobe is a 400 without the option and 200 with it, returning the first value in source order.
Paging is safe too: with 1200 documents the cursor carries the leniency, so page two still answers 200 from a cursor-only body.

Scoping it to Elasticsearch is right, and now measured: OpenSearch 3.8.0 returns the whole array for the same index with no error, so the fork has nothing to fix here.

Two things before it lands.

  • Docs belong in the same PR in this repo: docs/providers/elasticsearch.md section 5.4 is the home for it, and it should carry the sharp part of the measurement, SELECT tags FROM arrprobe WHERE tags = 'alpha' matches every row and then displays zebra, so the value that matched is not the value shown. A line in opensearch.md 5.4 for the asymmetry would help too.

  • Second, the OpenSearch suite only ever reads query out of a sent body, so nothing would fail if this option later reached the fork. One exact-body assertion there pins it.

Minor: the neighbouring spec members state every disagreement outright (aliasKey: null, totalKey: null), so a required boolean with false on opensearch would fit that table and drop the === true at the send site.

@cevheri cevheri added bug Something isn't working documentation Improvements or additions to documentation labels Sep 9, 2026

@cevheri cevheri left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation loop:needs-moderator-action Flagged by the maintainer loop: suspicious content or a decision only a human can make

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] elasticsearch selecting array columns - not supported

2 participants