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
2 changes: 1 addition & 1 deletion docs/reference/esql/functions/description/locate.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

*Description*

Returns an integer that indicates the position of a keyword substring within another string
Returns an integer that indicates the position of a keyword substring within another string. Returns `0` if the substring cannot be found. Note that string positions start from `1`.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"comment" : "This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.",
"type" : "eval",
"name" : "locate",
"description" : "Returns an integer that indicates the position of a keyword substring within another string",
"description" : "Returns an integer that indicates the position of a keyword substring within another string.\nReturns `0` if the substring cannot be found.\nNote that string positions start from `1`.",
"signatures" : [
{
"params" : [
Expand Down
4 changes: 3 additions & 1 deletion docs/reference/esql/functions/kibana/docs/locate.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../READ
-->

### LOCATE
Returns an integer that indicates the position of a keyword substring within another string
Returns an integer that indicates the position of a keyword substring within another string.
Returns `0` if the substring cannot be found.
Note that string positions start from `1`.

Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ greatest |Returns the maximum value from many columns.
least |Returns the minimum value from many columns.
left |Returns the substring that extracts 'length' chars from 'string' starting from the left.
length |Returns the character length of a string.
locate |Returns an integer that indicates the position of a keyword substring within another string
locate |Returns an integer that indicates the position of a keyword substring within another string. Returns `0` if the substring cannot be found. Note that string positions start from `1`.
log |Returns the logarithm of a value to a base. The input can be any numeric value, the return value is always a double. Logs of zero, negative numbers, and base of one return `null` as well as a warning.
log10 |Returns the logarithm of a value to base 10. The input can be any numeric value, the return value is always a double. Logs of 0 and negative numbers return `null` as well as a warning.
ltrim |Removes leading whitespaces from a string.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ public class Locate extends EsqlScalarFunction implements OptionalArgument {
private final Expression substr;
private final Expression start;

@FunctionInfo(
returnType = "integer",
description = "Returns an integer that indicates the position of a keyword substring within another string"
)
@FunctionInfo(returnType = "integer", description = """
Returns an integer that indicates the position of a keyword substring within another string.
Returns `0` if the substring cannot be found.
Note that string positions start from `1`.""")
public Locate(
Source source,
@Param(name = "string", type = { "keyword", "text" }, description = "An input string") Expression str,
Expand Down
Loading