Hello
I am new to Elasticsearch.
Yesterday I created content source and inserted few documents in workplace search.
Now I am trying to retrieve all the documents from that content source. What is the api that I need to use.
I tried couple and everything is erring out please help.
True, I was thinking about the same.
but I read the we can retrieve with index like
curl -X GET "https://{YOUR_SERVER}:9200/{YOUR_INDEX}_search" -H 'Content-Type: application/json' -d
Worked...... I was able to get all my documents along with many more information.
I completely agree with you, that I should not use Elasticsearch. My use case is to get familiar with workplace search and evaluate whether we can incorporate in our organization.
So there is no way in workplace search at present to get info of my documents? If I want to update some document and If I don't remember its unique id then what are my options?
One option is to provide the documents with meaningful IDs when you index them. Then you can use the Get document by ID API to retrieve them.
Another option is to use the Search API as @dadoonet originally suggested. With an empty query term, this will return the first 100 documents, and with pagination you can use it to "list" up to 10k documents. Note that since this is a "search", documents that tie in score may be returned in different orders, depending on which shard is queried under the hood.
Be patient. You're not the first to request a List All Documents API, and we are working to introduce one. However the desire to return results in a consistent order and allow you to scan though an arbitrarily large dataset has some fun and complex technical considerations, which is why it wasn't added originally. Hopefully this will be available in a release soon.
Thank you for providing me with some options. And relieved to hear that I am not the first person to ask.
1. I tried your first option to retrieve a single document by its Id. It worked wonderfully.
2. About the second option search API,
POST /api/ws/v1/search
I get below error : { "error" : "no handler found for uri [/api/ws/v1/search?pretty=true] and method [POST]" }
That error looks like you may have run it from Kibana dev tools? You can't currently use the Kibana dev tools to interact with Enterprise Search APIs - you'll need to use something like CUrl. Like:
Good news, @Mymail_Cpn! I can now share that the List Documents API is coming soon! While not yet released, we have put the documentation for it out to the public: see Listing Documents.
This typically indicates that the feature will be available in the next release. So stay tuned!
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.