Dots in index and searching

Hi,
I am pretty new to ES: I have to create an index which is dot seperated something like,
// minions.dev.contents/minion02.retro/noise:2019-08-01T19:42:45.000Z

and the contents is
//
{
"noise" : "25",
"temperature" : 33,
"pressure" : 112
}

where noise:2019-08-01Txxxxx is the ID of the document.

I am trying to do a SQL search
localhost:9200/_sql?format=txt
{
"query": "SELECT * FROM 'minions.dev.contents' WHERE noise < 25"
}

I am getting an input mismatch exception
mismatched input ''minions.dev.contents'' expecting {'(',

I am wondering if this is allowed, is there a better practice for storing groups and subgroup and have unique documents based on timestamp ?!

some tips would be helpful
thanks
Candy

The issue is, in fact, with how you name the index. When reserved characters are used in the name of the index, you should use double quotes. Single quotes and double quotes have different meaning in SQL. More about this here.

So, your request should look like "query": "SELECT * FROM \"minions.dev.contents\" WHERE noise < 25".

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.