Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid index name [_sql] #29

Closed
kaliseo opened this issue Jan 7, 2015 · 15 comments
Closed

Invalid index name [_sql] #29

kaliseo opened this issue Jan 7, 2015 · 15 comments

Comments

@kaliseo
Copy link

kaliseo commented Jan 7, 2015

Unable to make a query.

My ElasticSearch version is 1.4.1

@omershelef
Copy link
Contributor

What is the query you were trying to make?

@kaliseo
Copy link
Author

kaliseo commented Jan 8, 2015

Simple match_all query

Le Wed Jan 07 2015 at 19:03:52, Omer Shelef notifications@github.com a
écrit :

What is the query you were trying to make?


Reply to this email directly or view it on GitHub
#29 (comment)
.

@kaliseo
Copy link
Author

kaliseo commented Jan 8, 2015

"SELECT * FROM [myindex] LIMIT 100;"

Le Thu Jan 08 2015 at 21:55:38, Thierry LEFORESTIER kali.seo@gmail.com a
écrit :

Simple match_all query

Le Wed Jan 07 2015 at 19:03:52, Omer Shelef notifications@github.com a
écrit :

What is the query you were trying to make?


Reply to this email directly or view it on GitHub
#29 (comment)
.

@omershelef
Copy link
Contributor

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 omershelef reopened this Jan 8, 2015
@vixriihi
Copy link

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}

@omershelef
Copy link
Contributor

What version of elasticsearch-sql are you using?

@vixriihi
Copy link

1.2

@kaliseo
Copy link
Author

kaliseo commented Jan 16, 2015

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 <
notifications@github.com> a écrit :

1.2


Reply to this email directly or view it on GitHub
#29 (comment)
.

@omershelef
Copy link
Contributor

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.

@vixriihi
Copy link

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

@omershelef
Copy link
Contributor

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

@vixriihi
Copy link

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

@VictorCano
Copy link

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!!

@TarasB
Copy link

TarasB commented Mar 28, 2015

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

@dpj2010
Copy link

dpj2010 commented Apr 29, 2016

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}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants