Skip to content

Commit 184d466

Browse files
committed
2 parents 1b36ef8 + 7b32409 commit 184d466

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,11 +334,11 @@ or
334334

335335
Handling dependant documents is bit tricky since indexing a child document requires the presence of its parent document. A simple approach is to export the documents into seperate archives by using a query. In case your child documents are located in the same type as the parent documents, define the appropriate filter in the query. If you have stored the child documents in a seperate type, you can export the type containing the parent documents like this:
336336

337-
curl -XPOST 'localhost:9200/myIndex/myParentDocs/_export?path=/tmp/myIndex_myParentDocs.zip'
337+
curl -XPOST 'localhost:9200/myIndex/myParentDocs/_export?archivepath=/tmp/myIndex_myParentDocs.zip'
338338

339339
When exporting the type containing the child documents, include the "_parent" meta field
340340

341-
curl -XPOST 'localhost:9200/myIndex/myChildDocs/_export?path=/tmp/myIndex_myChildDocs.zip'' -d '{
341+
curl -XPOST 'localhost:9200/myIndex/myChildDocs/_export?archivepath=/tmp/myIndex_myChildDocs.zip'' -d '{
342342
"query" : {
343343
"match_all" : {
344344
}
@@ -351,11 +351,11 @@ When exporting the type containing the child documents, include the "_parent" me
351351

352352
Before you import the parent documents, you have to create the index manually first: Each type export only contains the mapping of that spedific type and you cannot add a dependant mapping in a second step later. All dependant mappings must be created at the same time otherwise you'll get an error like "java.lang.IllegalArgumentException: Can't specify parent if no parent field has been configured". After creating the index, import the parent documents:
353353

354-
curl -XPOST 'localhost:9200/myIndex/myParentDocs/_import?path=/tmp/myIndex_myParentDocs.zip&createIndex=false'
354+
curl -XPOST 'localhost:9200/myIndex/myParentDocs/_import?archivepath=/tmp/myIndex_myParentDocs.zip&createIndex=false'
355355

356356
Then import the child documents:
357357

358-
curl -XPOST 'localhost:9200/myIndex/myChildDocs/_import?path=/tmp/myIndex_myChildDocs.zip&createIndex=false'
358+
curl -XPOST 'localhost:9200/myIndex/myChildDocs/_import?archivepath=/tmp/myIndex_myChildDocs.zip&createIndex=false'
359359

360360
Repeat this for all your child types.
361361

0 commit comments

Comments
 (0)