post _sql
{
"query": """
select site_name,projectName,count(*) from dev_base_info where area_id is not null and dev_name="ss" group by site_name,projectName
"""
}
this return : Request failed to get to the server (status code: 500)
i check the es logs , nothing found.
when i change the sql like this:
post _sql
{
"query": """
select site_name,projectName,count(*) from dev_base_info where area_id is not null group by site_name,projectName
"""
}
it's ok
is there any config error? the es version is 8.15.0
POST /_sql?format=txt
{
"query": "select site_name,projectName,count(*) from dev_base_info where area_id is not null and dev_name='ss' group by site_name,projectName"
}
No Elasticsearch SQL, é recomendado usar aspas simples para strings em consultas. Alterar sua consulta para usar aspas simples pode resolver o problema:
POST _sql
{
"query": """
SELECT site_name, projectName, COUNT(*)
FROM dev_base_info
WHERE area_id IS NOT NULL AND dev_name = 'ss'
GROUP BY site_name, projectName
"""
}
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.