Skip to content

Commit 7b32409

Browse files
committed
Merge pull request #100 from marbleman/master
Master
2 parents 68e21fd + fe2ef0a commit 7b32409

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
@@ -333,11 +333,11 @@ or
333333

334334
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:
335335

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

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

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

351351
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:
352352

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

355355
Then import the child documents:
356356

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

359359
Repeat this for all your child types.
360360

0 commit comments

Comments
 (0)