After reading and trying several of articles and getting no result..
I want to create and elasticsearch query that returns data base results
Example:
[Step 1]: my db is [my_db] and my table name is [my_table] to build new index on localhost:9200
POST /my_index/my_type/_meta
{
"type":"jdbc",
"jdbc":
{
"driver":"com.microsoft.sqlserver.jdbc.SQLServerDriver",
"url":"jdbc:sqlserver://[my_db_ip];databaseName=[my_db]",
"user":"sa","password":"xxxxxx",
"sql":"SELECT * FROM [my_table]",
"poll":"5s",
"index": "my_index",
"type": "my_type"
}
}
The index creation result:
{
"_index": "my_index",
"_type": "my_type",
"_id": "_meta",
"_version": 1,
"created": true
}
[Step 2]: The search query
POST /my_index/_search
{
"query_string" : {
"query" : "FreeText"
}
}
The search result
{
"error": "SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures....
}
what is wrong with my search query??
how can i create a query that returns results from [my_table] rows?