Skip to content

Commit e7de770

Browse files
committed
Spotless
1 parent 29c6b2f commit e7de770

File tree

2 files changed

+55
-17
lines changed
  • x-pack/plugin/esql/src
    • main/java/org/elasticsearch/xpack/esql/expression/function/fulltext
    • test/java/org/elasticsearch/xpack/esql/expression/function/fulltext

2 files changed

+55
-17
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/fulltext/Match.java

Lines changed: 54 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,33 @@ public Match(
173173
description = "Value to find in the provided field."
174174
) Expression matchQuery,
175175
@MapParam(
176-
name="options",
176+
name = "options",
177177
params = {
178-
@MapParam.MapParamEntry(name = "analyzer", valueHint = { "standard" }, description = "Analyzer used to convert the text in the query value into token."),
179-
@MapParam.MapParamEntry(name = "auto_generate_synonyms_phrase_query", valueHint = { "true", "false" }, description = "If true, match phrase queries are automatically created for multi-term synonyms."),
180-
@MapParam.MapParamEntry(name = "fuzziness", valueHint = { "AUTO", "1", "2" }, description = "Maximum edit distance allowed for matching."),
181-
@MapParam.MapParamEntry(name = "boost", valueHint = { "2.5" }, description = "Floating point number used to decrease or increase the relevance scores of the query."),
182-
@MapParam.MapParamEntry(name = "fuzzy_transpositions", valueHint = { "true", "false" }, description = "If true, edits for fuzzy matching include transpositions of two adjacent characters (ab → ba)."),
178+
@MapParam.MapParamEntry(
179+
name = "analyzer",
180+
valueHint = { "standard" },
181+
description = "Analyzer used to convert the text in the query value into token."
182+
),
183+
@MapParam.MapParamEntry(
184+
name = "auto_generate_synonyms_phrase_query",
185+
valueHint = { "true", "false" },
186+
description = "If true, match phrase queries are automatically created for multi-term synonyms."
187+
),
188+
@MapParam.MapParamEntry(
189+
name = "fuzziness",
190+
valueHint = { "AUTO", "1", "2" },
191+
description = "Maximum edit distance allowed for matching."
192+
),
193+
@MapParam.MapParamEntry(
194+
name = "boost",
195+
valueHint = { "2.5" },
196+
description = "Floating point number used to decrease or increase the relevance scores of the query."
197+
),
198+
@MapParam.MapParamEntry(
199+
name = "fuzzy_transpositions",
200+
valueHint = { "true", "false" },
201+
description = "If true, edits for fuzzy matching include transpositions of two adjacent characters (ab → ba)."
202+
),
183203
@MapParam.MapParamEntry(
184204
name = "fuzzy_rewrite",
185205
valueHint = {
@@ -188,14 +208,35 @@ public Match(
188208
"constant_score_boolean",
189209
"top_terms_blended_freqs_N",
190210
"top_terms_boost_N",
191-
"top_terms_N" }, description = "Method used to rewrite the query. See the rewrite parameter for valid values and more information."
211+
"top_terms_N" },
212+
description = "Method used to rewrite the query. See the rewrite parameter for valid values and more information."
213+
),
214+
@MapParam.MapParamEntry(
215+
name = "lenient",
216+
valueHint = { "true", "false" },
217+
description = "If false, format-based errors, such as providing a text query value for a numeric field, are not ignored."
218+
),
219+
@MapParam.MapParamEntry(
220+
name = "max_expansions",
221+
valueHint = { "50" },
222+
description = "Maximum number of terms to which the query will expand."
223+
),
224+
@MapParam.MapParamEntry(
225+
name = "minimum_should_match",
226+
valueHint = { "2" },
227+
description = "Minimum number of clauses that must match for a document to be returned."
228+
),
229+
@MapParam.MapParamEntry(
230+
name = "operator",
231+
valueHint = { "AND", "OR" },
232+
description = "Boolean logic used to interpret text in the query value"
192233
),
193-
@MapParam.MapParamEntry(name = "lenient", valueHint = { "true", "false" }, description = "If false, format-based errors, such as providing a text query value for a numeric field, are not ignored."),
194-
@MapParam.MapParamEntry(name = "max_expansions", valueHint = { "50" }, description = "Maximum number of terms to which the query will expand."),
195-
@MapParam.MapParamEntry(name = "minimum_should_match", valueHint = { "2" }, description = "Minimum number of clauses that must match for a document to be returned."),
196-
@MapParam.MapParamEntry(name = "operator", valueHint = { "AND", "OR" }, description = "Boolean logic used to interpret text in the query value"),
197234
@MapParam.MapParamEntry(name = "prefix_length", valueHint = { "1" }, description = ""),
198-
@MapParam.MapParamEntry(name = "zero_terms_query", valueHint = { "none", "all" }, description = "Number of beginning characters left unchanged for fuzzy matching.")},
235+
@MapParam.MapParamEntry(
236+
name = "zero_terms_query",
237+
valueHint = { "none", "all" },
238+
description = "Number of beginning characters left unchanged for fuzzy matching."
239+
) },
199240
description = "Match additional options. See <<query-dsl-match-query,match query>> for more information.",
200241
optional = true
201242
) Expression options
@@ -456,7 +497,7 @@ private boolean isOperator() {
456497
@Override
457498
public boolean equals(Object o) {
458499
// Match does not serialize options, as they get included in the query builder. We need to override equals and hashcode to
459-
// ignore options when comparing two Match functions
500+
// ignore options when comparing two Match functions
460501
if (o == null || getClass() != o.getClass()) return false;
461502
Match match = (Match) o;
462503
return Objects.equals(field(), match.field())

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/fulltext/MatchTests.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -399,10 +399,7 @@ private static void addMatchOptions(List<TestCaseSupplier> suppliers) {
399399
new TestCaseSupplier.TypedData(
400400
new MapExpression(
401401
Source.EMPTY,
402-
List.of(
403-
new Literal(Source.EMPTY, optionName, KEYWORD),
404-
new Literal(Source.EMPTY, optionValue, optionType)
405-
)
402+
List.of(new Literal(Source.EMPTY, optionName, KEYWORD), new Literal(Source.EMPTY, optionValue, optionType))
406403
),
407404
UNSUPPORTED,
408405
"options"

0 commit comments

Comments
 (0)