You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/crud.asciidoc
+30-28Lines changed: 30 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,11 @@
1
1
[[indexing_documents]]
2
2
== Indexing Documents
3
3
4
+
IMPORTANT: Please note that mapping types will disappear from Elasticsearch, https://www.elastic.co/guide/en/elasticsearch/reference/7.x/removal-of-types.html[Link: read more].
5
+
4
6
When you add documents to Elasticsearch, you index JSON documents. This maps naturally to PHP associative arrays, since
5
7
they can easily be encoded in JSON. Therefore, in Elasticsearch-PHP you create and pass associative arrays to the client
6
-
for indexing. There are several methods of ingesting data into Elasticsearch, which we will cover here
8
+
for indexing. There are several methods of ingesting data into Elasticsearch, which we will cover here.
7
9
8
10
=== Single document indexing
9
11
@@ -16,9 +18,9 @@ When indexing a document, you can either provide an ID or let elasticsearch gene
16
18
----
17
19
$params = [
18
20
'index' => 'my_index',
19
-
'type' => 'my_type',
20
-
'id' => 'my_id',
21
-
'body' => [ 'testField' => 'abc']
21
+
'type' => 'my_type',
22
+
'id' => 'my_id',
23
+
'body' => [ 'testField' => 'abc']
22
24
];
23
25
24
26
// Document will be indexed to my_index/my_type/my_id
0 commit comments