How search in firsts characters

Hi, I’m a beginner in opensearch and I was having difficulties in elasticsearch and in this I found a possibility to use it in opensearch.
I wanted to know if I would have a possibility to perform the search in a specific field, for example, the field has 100 characters and I wanted to search for a specific term in the first 30 characters and if you happen to find and return the fields, records found. Is there such a way in opensearch?

1 Like

I found a way to more he brings all the values, and in this way he still couldn’t help me

POST _plugins/_sql
{
“query” : “SELECT if(substr(field, 1, 15) like ‘%key%’, 0, 1), substr(field, 1, 15), id FROM indice”
}