ToB企服应用市场:ToB评测及商务社交产业平台

标题: [C++][第三方库][Elasticsearch]详细讲授 [打印本页]

作者: 惊落一身雪    时间: 2024-10-8 17:50
标题: [C++][第三方库][Elasticsearch]详细讲授

1.介绍



2.安装

1.ES



2.Kibana



3.ES核心概念

1.索引(index)



2.类型(Type)



3.字段(Field)



4.映射(mapping)



5.文档(document)



4.Kibana访问ES举行测试



5.ES客户端的安装



6.ES客户端接口介绍

  1. /**
  2. * Perform search on nodes until it is successful. Throws
  3. exception if all nodes
  4. * has failed to respond.
  5. * \param indexName specification of an Elasticsearch index.
  6. * \param docType specification of an Elasticsearch document type.
  7. * \param body Elasticsearch request body.
  8. * \param routing Elasticsearch routing. If empty, no routing has
  9. been used.
  10. *
  11. * \return cpr::Response if any of node responds to request.
  12. * \throws ConnectionException if all hosts in cluster failed to
  13. respond.
  14. */
  15. cpr::Response search(const std::string &indexName,
  16.                      const std::string &docType,
  17.                      const std::string &body,
  18.                      const std::string &routing = std::string());
  19. /**
  20. * Get document with specified id from cluster. Throws exception
  21. if all nodes
  22. * has failed to respond.
  23. * \param indexName specification of an Elasticsearch index.
  24. * \param docType specification of an Elasticsearch document type.
  25. * \param id Id of document which should be retrieved.
  26. * \param routing Elasticsearch routing. If empty, no routing has
  27. been used.
  28. *
  29. * \return cpr::Response if any of node responds to request.
  30. * \throws ConnectionException if all hosts in cluster failed to
  31. respond.
  32. */
  33. cpr::Response get(const std::string &indexName,
  34.                   const std::string &docType,
  35.                   const std::string &id = std::string(),
  36.                   const std::string &routing = std::string());
  37. /**
  38. * Index new document to cluster. Throws exception if all nodes
  39. has failed to respond.
  40. * \param indexName specification of an Elasticsearch index.
  41. * \param docType specification of an Elasticsearch document type.
  42. * \param body Elasticsearch request body.
  43. * \param id Id of document which should be indexed. If empty, id
  44. will be generated
  45. *           automatically by Elasticsearch cluster.
  46. * \param routing Elasticsearch routing. If empty, no routing has
  47. been used.
  48. *
  49. * \return cpr::Response if any of node responds to request.
  50. * \throws ConnectionException if all hosts in cluster failed to
  51. respond.
  52. */
  53. cpr::Response index(const std::string &indexName,
  54.                     const std::string &docType,
  55.                     const std::string &id,
  56.                     const std::string &body,
  57.                     const std::string &routing = std::string());
  58. /**
  59. * Delete document with specified id from cluster. Throws
  60. exception if all nodes
  61. * has failed to respond.
  62. * \param indexName specification of an Elasticsearch index.
  63. * \param docType specification of an Elasticsearch document type.
  64. * \param id Id of document which should be deleted.
  65. * \param routing Elasticsearch routing. If empty, no routing has
  66. been used.
  67. *
  68. * \return cpr::Response if any of node responds to request.
  69. * \throws ConnectionException if all hosts in cluster failed to
  70. respond.
  71. */
  72. cpr::Response remove(const std::string &indexName,
  73.                      const std::string &docType,
  74.                      const std::string &id,
  75.                      const std::string &routing = std::string());
复制代码

7.利用




免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。




欢迎光临 ToB企服应用市场:ToB评测及商务社交产业平台 (https://dis.qidao123.com/) Powered by Discuz! X3.4