Child documents are sometimes not searchable. I have a parent-child relationship where the mapping looks like
{
"parent": {
"id": "keyword",
"name": "text"
}
"childId": "keyword",
"childName": "text",
"_join_field": {
"type": "join",
"relations": { "parentDoc": ["childDoc"] }
}
}
I am then indexing the child document using the bulk API like so:
{"index":{"_index":"my_index","_id":"childId.2984947e-1588-4fd3-8518-a2e3f2d5398e:parentId.f832b55a-883f-442b-b3f2-492d428e8fa1","routing":"parentId.f832b55a-883f-442b-b3f2-492d428e8fa1"}}
{"name":"test child","childId":"childId.2984947e-1588-4fd3-8518-a2e3f2d5398e","_join_field":{"name":"childDoc","parent":"parentId.f832b55a-883f-442b-b3f2-492d428e8fa1"}}
and indexing the parent document using the bulk API like so:
{"index":{"_index":"my_index","_id":"parentId.f832b55a-883f-442b-b3f2-492d428e8fa1"}}
{"parent": {"id": "parentId.f832b55a-883f-442b-b3f2-492d428e8fa1", "name": "test parent"}}
The child document is not searchable at all using a term query like:
POST /my_index/_search
{
"query": {
"term": {
"childId": { "value": "childId.2984947e-1588-4fd3-8518-a2e3f2d5398e:parentId.f832b55a-883f-442b-b3f2-492d428e8fa1" }
}
}
Or using a termvectors request like:
GET /my_index/_termvectors/childId.2984947e-1588-4fd3-8518-a2e3f2d5398e:parentId.f832b55a-883f-442b-b3f2-492d428e8fa1
However I am able to retrieve it using an ids query which is telling me that the document is stored, but not analyzed. I validated the mappings to ensure they match the document structure.
Also, this is only sometimes happening, and other times the child docs are indexed successfully and are able to be searched. Is there some limit to how many child documents can exist in an index and it just silently does not analyze? Is there something else I should look out for to ensure that the documents are getting analyzed?
I am using ES version 7.17.7
Thank you!