Hello,
I have come across a problem where I am not getting any data back when I try to _search an index. I previously followed along with this tutorial. Everything went fine when following along and using the online "Docker Playground" that is mentioned. However, I am currently trying to do something similar on my own machine which is giving me some trouble.
I am using the docker-compose file found on the Install Elasticsearch with Docker page to create my cluster. I get success responses when creating indexes and when putting documents into those indexes. Whenever I try to query the index I get an empty result set back.
PS C:\WINDOWS\system32> Invoke-RestMethod -Method Put `
>> -Uri "http://localhost:9200/customer/_doc/3?pretty" `
>> -ContentType "application/json" -Body @"
>> { "name" : "John Doe" }
>> "@
_index : customer
_type : _doc
_id : 3
_version : 1
result : created
_shards : @{total=2; successful=2; failed=0}
_seq_no : 1
_primary_term : 3
However, when I try to retrieve the documents in the index I get:
PS C:\WINDOWS\system32> Invoke-RestMethod http://localhost:9200/customer/_search?pretty
took timed_out _shards hits
---- --------- ------- ----
45 False @{total=1; successful=1; skipped=0; failed=0} @{total=; max_score=1.0; hits=System.Object[]}
I'm at a bit of a loss because I am getting successful responses from the creation of the documents, but they are not being returned when I try to query them.
Thank you for any help in advance!