Elasticsearch: Difference between revisions

Jump to navigation Jump to search
482 bytes added ,  15 October 2024
Line 26: Line 26:


== Create the index or table ==
== Create the index or table ==
Elasticsearch: [https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html#mappings Create index API | Elasticsearch Guide [8.15] | Elastic]<ref>[https://opster.com/guides/elasticsearch/search-apis/elasticsearch-strings-keyword-vs-text-vs-wildcard/ Elasticsearch Keyword VS. Text - Strings Types Explained]</ref><ref>[https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html Field data types | Elasticsearch Guide [8.15] | Elastic]</ref>
Elasticsearch<ref>[https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html#mappings Create index API | Elasticsearch Guide [8.15] | Elastic]</ref><ref>[https://opster.com/guides/elasticsearch/search-apis/elasticsearch-strings-keyword-vs-text-vs-wildcard/ Elasticsearch Keyword VS. Text - Strings Types Explained]</ref><ref>[https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html Field data types | Elasticsearch Guide [8.15] | Elastic]</ref>
<pre>
<pre>
PUT /MY_INXEX
PUT /MY_INXEX
Line 39: Line 39:
</pre>
</pre>


MySQL [https://dev.mysql.com/doc/refman/8.4/en/create-table.html MySQL :: MySQL 8.4 Reference Manual :: 15.1.20 CREATE TABLE Statement]
MySQL<ref>[https://dev.mysql.com/doc/refman/8.4/en/create-table.html MySQL :: MySQL 8.4 Reference Manual :: 15.1.20 CREATE TABLE Statement]</ref>


<pre>
<pre>
Line 46: Line 46:
   field1 TEXT
   field1 TEXT
) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
</pre>
== Select the data from index or table ==
Elasticsearch<ref>[https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-index.html Get index API | Elasticsearch Guide [8.15] | Elastic]</ref>
<pre>
GET /MY_INDEX/_search/?size=1000&pretty=true
</pre>
MySQL<ref>[https://dev.mysql.com/doc/refman/8.4/en/selecting-all.html MySQL :: MySQL 8.4 Reference Manual :: 5.3.4.1 Selecting All Data]</ref>
<pre>
SELECT *
FROM MY_TABLE
LIMIT 1000
</pre>
</pre>


Navigation menu