Doctrine connections in mongodb to elasticsearch i

2019-08-08 19:37发布

I'm use symfony2 with doctrine odm (mongodb). I need create elasticsearch index, but its not hard. My structure Product collection (abridged):

{
    "_id": ObjectId("5239656f60663de206b1053e"),
    "category": {
        "$ref": "Category",
        "$id": ObjectId("50cb515760663d3577000043"),
        "$db": "<dbName>" 
    },
    "name": "<productName>"
}

Category collection:

{
    "_id": ObjectId("50cb515760663d3577000043"),
    "name": "<categoryName>"
}

category field in Product collection - have 3 sub fields, wich created doctrine. I'm need create index comprising only productName and categoryName. How i do it, thanks)

0条回答
登录 后发表回答