How to create the best index/type for my particular situation


(Erik Rijk) #1
"_index": "crm",
"_type": "employee",
"_id": "1",
"_score": 1,
"_source": {
    "type": null,
    "account": {
        "firstname": null,
        "accountAddress": {
        "street": null,
    }
}

I'm currently working on a project using Zend Framework2, Doctrine2 and Elasticsearch, Above is a small piece of a document I'm using.

With Doctrine, I'm fetching the entity change set for processing to elasticsearch but I'm not sure if this is the best way to do it.

Is it better to create more document types ( employee, account, accountaddress) or should I live it the way it is now?

In bigger search forms, I need all the data in the document.

// Erik


(Patrick Kik) #2

One of the best ways to store your data in Elasticsearch is in such a way that it's easy retrievable. Aggregate your data in one document to store, instead of using multiple queries to gather what you need.


(Erik Rijk) #3

Thought so!
Thanks for your response.


(system) #4