I'm using a query as shown below, however no matter what I try, I'm unable to insert a string variable into the query string (string variable is 'searchString'). It just won't compile.
I've tried various suggestions for inserting string variables but nothing works for me.
var searchResponse = await _elasticLowLevelClient.SearchAsync<StringResponse>("webapp-razor-*", @"
{
""from"": 0,
""size"": 10,
""query"": {
""match"": {
""_metadata.log_event_type"": {
""query"": """ + searchString + """
}
}
}
}");
The above method in the Elastic docs: