(Edited: replaced pictures from outputs by formated outputs)
Hi all, first of all: I greatly appreciate it that you want to take your time to see what is going wrong in my project.
I'm new to Elasticsearch and Kibana and I already experimented a very little bit with POST/GET/PUT-queries in ES (very basic stuff as I am new to query-language, http, and everything). Today I experimented a whole day to make exactly this tutorial to work. (See also this link).
Even though I did exactly what is done in the tutorial, I failed, I don't get it to work how it is supposed to be and I have no clue about what's going wrong & how I can solve this problem to be able to start experimenting more with Elasticsearch.
When I open Elasticsearch and execute this in Windows Powershell:
PS C:\Users\Jurgen> Invoke-RestMethod "http://localhost:9200/shakespeare/_bulk?pretty" -Method Post -ContentType 'application/x-ndjson' -InFile "shakespeare.json"
After waiting like 2 - 3 minutes I get this message in Windows Powershell:
took errors items
---- ------ -----
1023791 True {@{index=}, @{index=}, @{index=}, @{index=}...}
Then, when I open my Elasticsearch screen I see many lines like these, repeating, but for different lines in the json-file, the output is extremely long, only showing a part of it:
[2020-04-18T17:52:12,066][DEBUG][o.e.a.a.i.m.p.TransportPutMappingAction] [LAPTOP-Jurgen] failed to put mappings on indices [[[shakespeare/fIJuCa76RN62H72Ga8OKUQ]]], type [line]
java.lang.IllegalArgumentException: Rejecting mapping update to [shakespeare] as the final mapping would have more than 1 type: [_doc, line]
at org.elasticsearch.cluster.metadata.MetaDataMappingService$PutMappingExecutor.applyRequest(MetaDataMappingService.java:272) ~[elasticsearch-7.6.2.jar:7.6.2]
at org.elasticsearch.cluster.metadata.MetaDataMappingService$PutMappingExecutor.execute(MetaDataMappingService.java:238) ~[elasticsearch-7.6.2.jar:7.6.2]
at org.elasticsearch.cluster.service.MasterService.executeTasks(MasterService.java:702) ~[elasticsearch-7.6.2.jar:7.6.2]
at org.elasticsearch.cluster.service.MasterService.calculateTaskOutputs(MasterService.java:324) ~[elasticsearch-7.6.2.jar:7.6.2]
at org.elasticsearch.cluster.service.MasterService.runTasks(MasterService.java:219) [elasticsearch-7.6.2.jar:7.6.2]
at org.elasticsearch.cluster.service.MasterService.access$000(MasterService.java:73) [elasticsearch-7.6.2.jar:7.6.2]
at org.elasticsearch.cluster.service.MasterService$Batcher.run(MasterService.java:151) [elasticsearch-7.6.2.jar:7.6.2]
at org.elasticsearch.cluster.service.TaskBatcher.runIfNotProcessed(TaskBatcher.java:150) [elasticsearch-7.6.2.jar:7.6.2]
at org.elasticsearch.cluster.service.TaskBatcher$BatchedTask.run(TaskBatcher.java:188) [elasticsearch-7.6.2.jar:7.6.2]
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:633) [elasticsearch-7.6.2.jar:7.6.2]
at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:252) [elasticsearch-7.6.2.jar:7.6.2]
at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:215) [elasticsearch-7.6.2.jar:7.6.2]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:830) [?:?]
[2020-04-18T17:52:12,066][DEBUG][o.e.a.b.TransportShardBulkAction] [LAPTOP-Jurgen] [shakespeare][0] failed to execute bulk item (index) index {[shakespeare][line][111395], source[{"line_id":111396,"play_name":"A Winters Tale","speech_number":38,"line_number":"","speaker":"LEONTES","text_entry":"Exeunt"}]}
java.lang.IllegalArgumentException: Rejecting mapping update to [shakespeare] as the final mapping would have more than 1 type: [_doc, line]
at org.elasticsearch.cluster.metadata.MetaDataMappingService$PutMappingExecutor.applyRequest(MetaDataMappingService.java:272) ~[elasticsearch-7.6.2.jar:7.6.2]
at org.elasticsearch.cluster.metadata.MetaDataMappingService$PutMappingExecutor.execute(MetaDataMappingService.java:238) ~[elasticsearch-7.6.2.jar:7.6.2]
at org.elasticsearch.cluster.service.MasterService.executeTasks(MasterService.java:702) ~[elasticsearch-7.6.2.jar:7.6.2]
at org.elasticsearch.cluster.service.MasterService.calculateTaskOutputs(MasterService.java:324) ~[elasticsearch-7.6.2.jar:7.6.2]
at org.elasticsearch.cluster.service.MasterService.runTasks(MasterService.java:219) [elasticsearch-7.6.2.jar:7.6.2]
at org.elasticsearch.cluster.service.MasterService.access$000(MasterService.java:73) [elasticsearch-7.6.2.jar:7.6.2]
at org.elasticsearch.cluster.service.MasterService$Batcher.run(MasterService.java:151) [elasticsearch-7.6.2.jar:7.6.2]
at org.elasticsearch.cluster.service.TaskBatcher.runIfNotProcessed(TaskBatcher.java:150) [elasticsearch-7.6.2.jar:7.6.2]
at org.elasticsearch.cluster.service.TaskBatcher$BatchedTask.run(TaskBatcher.java:188) [elasticsearch-7.6.2.jar:7.6.2]
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:633) [elasticsearch-7.6.2.jar:7.6.2]
at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:252) [elasticsearch-7.6.2.jar:7.6.2]
at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:215) [elasticsearch-7.6.2.jar:7.6.2]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:830) [?:?]
Then, when I go to to "http://localhost:5601" > Dev Tools and I execute following Kibana input:
GET /shakespeare/_search?q=Romeo
Kibana returns me this output:
{
"took" : 28,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 0,
"relation" : "eq"
},
"max_score" : null,
"hits" : [ ]
}
}
I expect it to be a very newbie-mistake but by far, googling my error messages didn't really get me anywhere and I also tried different ways of indexing the body of a json-file in Elasticsearch, e.g. using "Postman" instead of PowerShell but that also didn't really work...
Thanks for having a look at this.