xdmp:position( $test as xs:string?, $target as xs:string?, [$collation as xs:string?] ) as xs:integer?
Returns an integer value representing the starting position of a string within the search string. Note, the string starting position is 1. If the first parameter is empty, the result is the empty sequence.
xdmp:position("chin","searchintext") => 5
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.