elasticsearch-sql icon indicating copy to clipboard operation
elasticsearch-sql copied to clipboard

Invalid index name [_sql]

Open kaliseo opened this issue 11 years ago • 15 comments

Unable to make a query.

My ElasticSearch version is 1.4.1

kaliseo avatar Jan 07 '15 15:01 kaliseo

What is the query you were trying to make?

omershelef avatar Jan 07 '15 18:01 omershelef

Simple match_all query

Le Wed Jan 07 2015 at 19:03:52, Omer Shelef [email protected] a écrit :

What is the query you were trying to make?

— Reply to this email directly or view it on GitHub https://github.com/NLPchina/elasticsearch-sql/issues/29#issuecomment-69063303 .

kaliseo avatar Jan 08 '15 20:01 kaliseo

"SELECT * FROM [myindex] LIMIT 100;"

Le Thu Jan 08 2015 at 21:55:38, Thierry LEFORESTIER [email protected] a écrit :

Simple match_all query

Le Wed Jan 07 2015 at 19:03:52, Omer Shelef [email protected] a écrit :

What is the query you were trying to make?

— Reply to this email directly or view it on GitHub https://github.com/NLPchina/elasticsearch-sql/issues/29#issuecomment-69063303 .

kaliseo avatar Jan 08 '15 20:01 kaliseo

Elasticsearch-sql use MySQL dialect. square brackets is invalid in MySQL. if your index name is "myindex" just drop the brackets:

SELECT * FROM myindex

if your index name is "[myindex]". use backticks:

SELECT * FROM `[myindex]`

omershelef avatar Jan 08 '15 21:01 omershelef

Quoting doesn't seem to help (ES version 1.4.2) My query is:

SELECT * FROM `test_1`

and the result is always the same (with and without quotes):

{"error":"InvalidIndexNameException[[_sql] Invalid index name [_sql], must not start with '_']","status":400}

vixriihi avatar Jan 16 '15 08:01 vixriihi

What version of elasticsearch-sql are you using?

omershelef avatar Jan 16 '15 09:01 omershelef

1.2

vixriihi avatar Jan 16 '15 09:01 vixriihi

I didn't set bracket, it was just to give the index example ^^. Sorry

Le Fri Jan 16 2015 at 10:54:59, Ville-Matti Riihikoski < [email protected]> a écrit :

1.2

— Reply to this email directly or view it on GitHub https://github.com/NLPchina/elasticsearch-sql/issues/29#issuecomment-70231257 .

kaliseo avatar Jan 16 '15 11:01 kaliseo

I am trying to reproduce your problem. I installed elasticsearch 1.4.2 and elasticsearch-sql 1.2. but it seems to working fine on my computer. according to the error it seems that elasticsearch trying to query on index named "_sql" instead of the "test_1"...

Are you trying to query using the web frontend or the rest api? if you are using rest, what is the exact url you used?

what operating system are you using? what java version?

EDIT: I managed to reproduce the problem. using POST request when elasticsearch-sql not installed will cause this error. I assume you query through the web frontend, so maybe The plugin was not installed correctly. open the elasticsearch folder, plugins/sql. it should contains elasticsearch-sql-1.2.jar and _site folder. maybe the jar is missing? if the answer is yes, try to remove this folder, and reinstall.

omershelef avatar Jan 16 '15 13:01 omershelef

Yes. I was using web frontend and the jar was missing. Re-installed and now everything is working as expected. Thank you for a great plugin

vixriihi avatar Jan 16 '15 15:01 vixriihi

Happy to help. Do you have any idea why this jar was missing? you installed the plugin in a different way?

omershelef avatar Jan 16 '15 19:01 omershelef

Unfortunetly I don't. I used the one liner from the frontpage to install.

vixriihi avatar Jan 17 '15 09:01 vixriihi

Hi, i'm also experiencing this error, although in my sql plugin folder the .jar file exists. /usr/share/elasticsearch/plugins/sql# ls _site elasticsearch-sql-1.3.jar

I'm using ElasticSearch 1.4.2 and the 1.3 version of the plugin. Do you have any idea how I could get to fix this? Thanks!!

VictorCano avatar Feb 18 '15 20:02 VictorCano

Hi,

The same problem. File elasticsearch-sql-1.3.1.jar exists.

Error message: Error: {"error":"InvalidIndexNameException[[_sql] Invalid index name [sql], must not start with '']","status":400}

I tried ElasticSearch 1.4.4 and 1.5.0 - result is the same.

Additional info: OS - Centos 6.5 Java - Java(TM) SE Runtime Environment (build 1.7.0_60-b19)

Thank you, Taras

TarasB avatar Mar 28 '15 12:03 TarasB

Elasticsearch 2.3.1

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.1.0/elasticsearch-sql-2.3.1.0.zip After doing this, you need to restart the Elasticsearch server. Otherwise you may get errors like Invalid index name [sql], must not start with '']; ","status":400}.

dpj2010 avatar Apr 29 '16 09:04 dpj2010