I am trying to setup a parent child relationship and I can't seem to get the mapping config right. I'm using Symfony2.5, FOSElastica 3.0.9 and Elasticsearch 1.4.4
Here is the relevent section from my mapping:
# fos elastica
fos_elastica:
clients:
default: { host: 127.0.0.1, port: 9200 }
serializer:
callback_class: FOS\ElasticaBundle\Serializer\Callback
serializer: serializer
indexes:
index:
index_name: index_%kernel.environment%
client: default
types:
company:
mappings:
id:
type: "long"
company_name:
type: "string"
fields:
raw:
type: "string"
index: "analyzed"
index_analyzer: "sortable"
persistence:
elastica_to_model_transformer:
ignore_missing: true
driver: orm # orm, mongodb, propel are available
model: Alpha\RMSBundle\Entity\Company
provider: ~
finder: ~
listener: ~
serializer:
groups: [company]
job:
mappings:
id:
type: "long"
company:
type: "object"
properties:
id:
type: "long"
_parent:
type: company
property: company
identifier: id
#_routing:
# required: true
# path: company
persistence:
elastica_to_model_transformer:
ignore_missing: true
driver: orm # orm, mongodb, propel are available
model: Alpha\RMSBundle\Entity\JobOpening
provider: ~
finder: ~
listener: ~
serializer:
groups: [job]
First I populate company, but when I try to populate job I get the following error:
[Elastica\Exception\ResponseException]
RoutingMissingException[routing is required for [index_v2]/[job]/[1]]
I have tried specifying the routing which is commented out above, but that didn't set the relationship either, I have taken the routing out as it is not mentioned in the docs. Can anyone see where I am going wrong?