Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix points writing with no values #13378

Merged
merged 3 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lucene/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,8 @@ Bug Fixes
* GITHUB#13369: Fix NRT opening failure when soft deletes are enabled and the document fails to index before a point
field is written (Ben Trent)

* GITHUB#13378: Fix points writing with no values (Chris Hegarty)

Build
---------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,10 @@ private IORunnable writeFieldNDims(

pointCount = values.size();

if (pointCount == 0) {
return null;
}

final int numLeaves =
Math.toIntExact((pointCount + config.maxPointsInLeafNode - 1) / config.maxPointsInLeafNode);
final int numSplits = numLeaves - 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2338,6 +2338,8 @@ public TokenStreamComponents createComponents(String fieldName) {
LeafReader onlyReader = getOnlyLeafReader(r);
// we mark the failed doc as deleted
assertEquals(onlyReader.numDeletedDocs(), 1);
// there are not points values (rather than an empty set of values)
assertNull(onlyReader.getPointValues("field"));
onlyReader.close();
w.close();
dir.close();
Expand Down