|
26 | 26 | import org.elasticsearch.xpack.esql.core.type.DataType; |
27 | 27 | import org.elasticsearch.xpack.esql.core.type.DataTypeConverter; |
28 | 28 | import org.elasticsearch.xpack.esql.core.util.Check; |
| 29 | +import org.elasticsearch.xpack.esql.expression.function.Example; |
29 | 30 | import org.elasticsearch.xpack.esql.expression.function.FunctionAppliesTo; |
30 | 31 | import org.elasticsearch.xpack.esql.expression.function.FunctionAppliesToLifecycle; |
31 | 32 | import org.elasticsearch.xpack.esql.expression.function.FunctionInfo; |
@@ -146,9 +147,9 @@ public class MultiMatch extends FullTextFunction implements OptionalArgument, Po |
146 | 147 |
|
147 | 148 | TODO. |
148 | 149 | 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") }, |
152 | 153 | appliesTo = { |
153 | 154 | @FunctionAppliesTo( |
154 | 155 | lifeCycle = FunctionAppliesToLifecycle.COMING, |
@@ -176,8 +177,79 @@ public MultiMatch( |
176 | 177 | type = "float", |
177 | 178 | valueHint = { "2.5" }, |
178 | 179 | 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.", |
181 | 253 | optional = true |
182 | 254 | ) Expression options |
183 | 255 | ) { |
|
0 commit comments