Index and Query a Document
Posted shuaiandjun
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Index and Query a Document相关的知识,希望对你有一定的参考价值。
Let’s now put something into our customer index. We’ll index a simple customer document into the customer index, with an ID of 1 as follows:
curl -X PUT "localhost:9200/customer/_doc/1?pretty" -H ‘Content-Type: application/json‘ -d‘
{
"name": "John Doe"
}
‘
{ "_index" : "customer", "_type" : "_doc", "_id" : "1", "_version" : 1, "result" : "created", "_shards" : { "total" : 2, "successful" : 1, "failed" : 0 }, "_seq_no" : 0, "_primary_term" : 1 }
From the above, we can see that a new customer document was successfully created inside the customer index. The document also has an internal id of 1 which we specified at index time.
curl -X GET "localhost:9200/customer/_doc/1?pretty"
And the response:
{ "_index" : "customer", "_type" : "_doc", "_id" : "1", "_version" : 1, "found" : true, "_source" : { "name": "John Doe" } }
Nothing out of the ordinary here other than a field, found
, stating that we found a document with the requested ID 1 and another field, _source
, which returns the full JSON document that we indexed from the previous step.
以上是关于Index and Query a Document的主要内容,如果未能解决你的问题,请参考以下文章
[转]Have a query in Blue prism coding stage and collection stage.
SQL Server捕获发生The query processor ran out of internal resources and could not produce a query plan..
A query was run and no Result Maps were found for the Mapped Statement....
A query was run and no Result Maps were found for the Mapped Statement
A query was run and no Result Maps were found for the Mapped Statement
出错:Cause: org.apache.ibatis.executor.ExecutorException: A query was run and no Result Maps were foun