Skip to content
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
5 changes: 5 additions & 0 deletions docs/changelog/129278.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 129278
summary: Fix constant keyword optimization
area: ES|QL
type: bug
issues: []
8 changes: 4 additions & 4 deletions docs/reference/esql/functions/kibana/definition/knn.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions docs/reference/esql/functions/kibana/docs/knn.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ public CaseInsensitiveTermQuery(Term term) {

@Override
public String toString(String field) {
return this.getClass().getSimpleName() + "{" + field + ":" + term.text() + "}";
StringBuilder buffer = new StringBuilder();
buffer.append(getClass().getSimpleName());
buffer.append('{');
if (term.field().equals(field) == false) {
buffer.append(term.field());
buffer.append(':');
}
buffer.append(term.text());
buffer.append('}');
return buffer.toString();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ public Page getOutput() {
}

@Override
public void close() {
public void close() {}

@Override
public String toString() {
return "LocalSourceOperator";
}
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ public boolean canUseEqualityOnSyntheticSourceDelegate(FieldAttribute.FieldName
}

@Override
public String constantValue(FieldName name) {
public String constantValue(FieldAttribute.FieldName name) {
String val = null;
for (SearchExecutionContext ctx : contexts) {
MappedFieldType f = ctx.getFieldType(name.string());
Expand Down