README.asciidoc 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. = Elasticsearch
  2. Elasticsearch is a distributed, RESTful search engine optimized for speed and relevance on production-scale workloads. You can use Elasticsearch to perform real-time search over massive datasets for applications including:
  3. * Vector search
  4. * Full-text search
  5. * Logs
  6. * Metrics
  7. * Application performance monitoring (APM)
  8. * Security logs
  9. \... and more!
  10. To learn more about Elasticsearch's features and capabilities, see our
  11. https://www.elastic.co/products/elasticsearch[product page].
  12. [[get-started]]
  13. == Get started
  14. The simplest way to set up Elasticsearch is to create a managed deployment with
  15. https://www.elastic.co/cloud/as-a-service[Elasticsearch Service on Elastic
  16. Cloud].
  17. If you prefer to install and manage Elasticsearch yourself, you can download
  18. the latest version from
  19. https://www.elastic.co/downloads/elasticsearch[elastic.co/downloads/elasticsearch].
  20. === Run Elasticsearch locally
  21. ////
  22. IMPORTANT: This content is replicated in the Elasticsearch guide.
  23. If you make changes, you must also update setup/set-up-local-dev-deployment.asciidoc.
  24. ////
  25. To try out Elasticsearch on your own machine, we recommend using Docker
  26. and running both Elasticsearch and Kibana.
  27. Docker images are available from the https://www.docker.elastic.co[Elastic Docker registry].
  28. NOTE: Starting in Elasticsearch 8.0, security is enabled by default.
  29. The first time you start Elasticsearch, TLS encryption is configured automatically,
  30. a password is generated for the `elastic` user,
  31. and a Kibana enrollment token is created so you can connect Kibana to your secured cluster.
  32. For other installation options, see the
  33. https://www.elastic.co/guide/en/elasticsearch/reference/current/install-elasticsearch.html[Elasticsearch installation documentation].
  34. **Start Elasticsearch**
  35. . Install and start https://www.docker.com/products/docker-desktop[Docker
  36. Desktop]. Go to **Preferences > Resources > Advanced** and set Memory to at least 4GB.
  37. . Start an Elasticsearch container:
  38. +
  39. ----
  40. docker network create elastic
  41. docker pull docker.elastic.co/elasticsearch/elasticsearch:{version} <1>
  42. docker run --name elasticsearch --net elastic -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -t docker.elastic.co/elasticsearch/elasticsearch:{version}
  43. ----
  44. <1> Replace {version} with the version of Elasticsearch you want to run.
  45. +
  46. When you start Elasticsearch for the first time, the generated `elastic` user password and
  47. Kibana enrollment token are output to the terminal.
  48. +
  49. NOTE: You might need to scroll back a bit in the terminal to view the password
  50. and enrollment token.
  51. . Copy the generated password and enrollment token and save them in a secure
  52. location. These values are shown only when you start Elasticsearch for the first time.
  53. You'll use these to enroll Kibana with your Elasticsearch cluster and log in.
  54. **Start Kibana**
  55. Kibana enables you to easily send requests to Elasticsearch and analyze, visualize, and manage data interactively.
  56. . In a new terminal session, start Kibana and connect it to your Elasticsearch container:
  57. +
  58. ----
  59. docker pull docker.elastic.co/kibana/kibana:{version} <1>
  60. docker run --name kibana --net elastic -p 5601:5601 docker.elastic.co/kibana/kibana:{version}
  61. ----
  62. <1> Replace {version} with the version of Kibana you want to run.
  63. +
  64. When you start Kibana, a unique URL is output to your terminal.
  65. . To access Kibana, open the generated URL in your browser.
  66. .. Paste the enrollment token that you copied when starting
  67. Elasticsearch and click the button to connect your Kibana instance with Elasticsearch.
  68. .. Log in to Kibana as the `elastic` user with the password that was generated
  69. when you started Elasticsearch.
  70. **Send requests to Elasticsearch**
  71. You send data and other requests to Elasticsearch through REST APIs.
  72. You can interact with Elasticsearch using any client that sends HTTP requests,
  73. such as the https://www.elastic.co/guide/en/elasticsearch/client/index.html[Elasticsearch
  74. language clients] and https://curl.se[curl].
  75. Kibana's developer console provides an easy way to experiment and test requests.
  76. To access the console, go to **Management > Dev Tools**.
  77. **Add data**
  78. You index data into Elasticsearch by sending JSON objects (documents) through the REST APIs.
  79. Whether you have structured or unstructured text, numerical data, or geospatial data,
  80. Elasticsearch efficiently stores and indexes it in a way that supports fast searches.
  81. For timestamped data such as logs and metrics, you typically add documents to a
  82. data stream made up of multiple auto-generated backing indices.
  83. To add a single document to an index, submit an HTTP post request that targets the index.
  84. ----
  85. POST /customer/_doc/1
  86. {
  87. "firstname": "Jennifer",
  88. "lastname": "Walters"
  89. }
  90. ----
  91. This request automatically creates the `customer` index if it doesn't exist,
  92. adds a new document that has an ID of 1, and
  93. stores and indexes the `firstname` and `lastname` fields.
  94. The new document is available immediately from any node in the cluster.
  95. You can retrieve it with a GET request that specifies its document ID:
  96. ----
  97. GET /customer/_doc/1
  98. ----
  99. To add multiple documents in one request, use the `_bulk` API.
  100. Bulk data must be newline-delimited JSON (NDJSON).
  101. Each line must end in a newline character (`\n`), including the last line.
  102. ----
  103. PUT customer/_bulk
  104. { "create": { } }
  105. { "firstname": "Monica","lastname":"Rambeau"}
  106. { "create": { } }
  107. { "firstname": "Carol","lastname":"Danvers"}
  108. { "create": { } }
  109. { "firstname": "Wanda","lastname":"Maximoff"}
  110. { "create": { } }
  111. { "firstname": "Jennifer","lastname":"Takeda"}
  112. ----
  113. **Search**
  114. Indexed documents are available for search in near real-time.
  115. The following search matches all customers with a first name of _Jennifer_
  116. in the `customer` index.
  117. ----
  118. GET customer/_search
  119. {
  120. "query" : {
  121. "match" : { "firstname": "Jennifer" }
  122. }
  123. }
  124. ----
  125. **Explore**
  126. You can use Discover in Kibana to interactively search and filter your data.
  127. From there, you can start creating visualizations and building and sharing dashboards.
  128. To get started, create a _data view_ that connects to one or more Elasticsearch indices,
  129. data streams, or index aliases.
  130. . Go to **Management > Stack Management > Kibana > Data Views**.
  131. . Select **Create data view**.
  132. . Enter a name for the data view and a pattern that matches one or more indices,
  133. such as _customer_.
  134. . Select **Save data view to Kibana**.
  135. To start exploring, go to **Analytics > Discover**.
  136. [[upgrade]]
  137. == Upgrade
  138. To upgrade from an earlier version of Elasticsearch, see the
  139. https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-upgrade.html[Elasticsearch upgrade
  140. documentation].
  141. [[build-source]]
  142. == Build from source
  143. Elasticsearch uses https://gradle.org[Gradle] for its build system.
  144. To build a distribution for your local OS and print its output location upon
  145. completion, run:
  146. ----
  147. ./gradlew localDistro
  148. ----
  149. To build a distribution for another platform, run the related command:
  150. ----
  151. ./gradlew :distribution:archives:linux-tar:assemble
  152. ./gradlew :distribution:archives:darwin-tar:assemble
  153. ./gradlew :distribution:archives:windows-zip:assemble
  154. ----
  155. To build distributions for all supported platforms, run:
  156. ----
  157. ./gradlew assemble
  158. ----
  159. Distributions are output to `distribution/archives`.
  160. To run the test suite, see xref:TESTING.asciidoc[TESTING].
  161. [[docs]]
  162. == Documentation
  163. For the complete Elasticsearch documentation visit
  164. https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html[elastic.co].
  165. For information about our documentation processes, see the
  166. xref:docs/README.asciidoc[docs README].
  167. [[examples]]
  168. == Examples and guides
  169. The https://github.com/elastic/elasticsearch-labs[`elasticsearch-labs`] repo contains executable Python notebooks, sample apps, and resources to test out Elasticsearch for vector search, hybrid search and generative AI use cases.
  170. [[contribute]]
  171. == Contribute
  172. For contribution guidelines, see xref:CONTRIBUTING.md[CONTRIBUTING].
  173. [[questions]]
  174. == Questions? Problems? Suggestions?
  175. * To report a bug or request a feature, create a
  176. https://github.com/elastic/elasticsearch/issues/new/choose[GitHub Issue]. Please
  177. ensure someone else hasn't created an issue for the same topic.
  178. * Need help using Elasticsearch? Reach out on the
  179. https://discuss.elastic.co[Elastic Forum] or https://ela.st/slack[Slack]. A
  180. fellow community member or Elastic engineer will be happy to help you out.