Skip to content

Commit 463938d

Browse files
Documentation annotations
1 parent 8d72e21 commit 463938d

File tree

1 file changed

+77
-5
lines changed
  • x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/fulltext

1 file changed

+77
-5
lines changed

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

Lines changed: 77 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import org.elasticsearch.xpack.esql.core.type.DataType;
2727
import org.elasticsearch.xpack.esql.core.type.DataTypeConverter;
2828
import org.elasticsearch.xpack.esql.core.util.Check;
29+
import org.elasticsearch.xpack.esql.expression.function.Example;
2930
import org.elasticsearch.xpack.esql.expression.function.FunctionAppliesTo;
3031
import org.elasticsearch.xpack.esql.expression.function.FunctionAppliesToLifecycle;
3132
import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
@@ -146,9 +147,9 @@ public class MultiMatch extends FullTextFunction implements OptionalArgument, Po
146147
147148
TODO.
148149
TODO.""",
149-
// examples = {
150-
// @Example(file = "match-function", tag = "match-with-field"),
151-
// @Example(file = "match-function", tag = "match-with-named-function-params") },
150+
examples = {
151+
@Example(file = "multi-match-function", tag = "multi-match-with-field"),
152+
@Example(file = "multi-match-function", tag = "multi-match-with-named-function-params") },
152153
appliesTo = {
153154
@FunctionAppliesTo(
154155
lifeCycle = FunctionAppliesToLifecycle.COMING,
@@ -176,8 +177,79 @@ public MultiMatch(
176177
type = "float",
177178
valueHint = { "2.5" },
178179
description = "Floating point number used to decrease or increase the relevance scores of the query."
179-
) },
180-
description = "description",
180+
),
181+
@MapParam.MapParamEntry(
182+
name = "analyzer",
183+
type = "keyword",
184+
valueHint = { "standard" },
185+
description = "Analyzer used to convert the text in the query value into token. Defaults to the index-time analyzer"
186+
+ " mapped for the field. If no analyzer is mapped, the index’s default analyzer is used."
187+
),
188+
@MapParam.MapParamEntry(
189+
name = "auto_generate_synonyms_phrase_query",
190+
type = "boolean",
191+
valueHint = { "true", "false" },
192+
description = "If true, match phrase queries are automatically created for multi-term synonyms. Defaults to true."
193+
),
194+
@MapParam.MapParamEntry(
195+
name = "fuzziness",
196+
type = "keyword",
197+
valueHint = { "AUTO", "1", "2" },
198+
description = "Maximum edit distance allowed for matching."
199+
),
200+
@MapParam.MapParamEntry(
201+
name = "fuzzy_transpositions",
202+
type = "boolean",
203+
valueHint = { "true", "false" },
204+
description = "If true, edits for fuzzy matching include transpositions of two adjacent characters (ab → ba). "
205+
+ "Defaults to true."
206+
),
207+
@MapParam.MapParamEntry(
208+
name = "lenient",
209+
type = "boolean",
210+
valueHint = { "true", "false" },
211+
description = "If false, format-based errors, such as providing a text query value for a numeric field, are returned. "
212+
+ "Defaults to false."
213+
),
214+
@MapParam.MapParamEntry(
215+
name = "max_expansions",
216+
type = "integer",
217+
valueHint = { "50" },
218+
description = "Maximum number of terms to which the query will expand. Defaults to 50."
219+
),
220+
@MapParam.MapParamEntry(
221+
name = "minimum_should_match",
222+
type = "integer",
223+
valueHint = { "2" },
224+
description = "Minimum number of clauses that must match for a document to be returned."
225+
),
226+
@MapParam.MapParamEntry(
227+
name = "operator",
228+
type = "keyword",
229+
valueHint = { "AND", "OR" },
230+
description = "Boolean logic used to interpret text in the query value. Defaults to OR."
231+
),
232+
@MapParam.MapParamEntry(
233+
name = "prefix_length",
234+
type = "integer",
235+
valueHint = { "1" },
236+
description = "Number of beginning characters left unchanged for fuzzy matching. Defaults to 0."
237+
),
238+
@MapParam.MapParamEntry(
239+
name = "tie_breaker",
240+
type = "float",
241+
valueHint = { "0" },
242+
description = "Controls how score is blended together between field groups. Defaults to 0 (best score from each group)."
243+
),
244+
@MapParam.MapParamEntry(
245+
name = "type",
246+
type = "object",
247+
valueHint = { "'best_fields'" },
248+
description = "Controls internal execution strategy. Defaults to 'best_fields'."
249+
), },
250+
description = "(Optional) Additional options for MultiMatch, "
251+
+ "passed as <<esql-function-named-params,function named parameters>>.\"\n"
252+
+ " See <<query-dsl-multi-match-query,multi-match query>> for more information.",
181253
optional = true
182254
) Expression options
183255
) {

0 commit comments

Comments
 (0)