- 
                Notifications
    
You must be signed in to change notification settings  - Fork 55
 
FAQs
- In the example I don't see any reference of where the 
model-config.jsonis modified - Why aren't multiple indexes supported or why is the name of ONE index required for the setup? Seems strange to me.
 
In the example I don't see any reference of where the
model-config.jsonis modified
Let's say your model-config looks like:
{
    ...
    "User": {
        "dataSource": "db"
    },
    "AccessToken": {
        "dataSource": "db",
        ...
    },
    "ACL": {
        "dataSource": "db",
        ...
    },
    "RoleMapping": {
        "dataSource": "db",
        ...
    },
    "Role": {
        "dataSource": "db",
        ...
    },
    "UserModel": {
        "dataSource": "db"
    }
}
Since each of the following sample datasource files define the name of the datasource to be db ... there is nothing for you to change!
- https://github.com/strongloop-community/loopback-connector-elastic-search/blob/master/examples/server/datasources.sample-es-plain-1.js#L2
 - https://github.com/strongloop-community/loopback-connector-elastic-search/blob/master/examples/server/datasources.sample-es-plain-2.js#L2
 - https://github.com/strongloop-community/loopback-connector-elastic-search/blob/master/examples/server/datasources.sample-es-ssl-1.js#L2
 
BUT if you're looking at https://github.com/strongloop-community/loopback-connector-elastic-search/blob/master/examples/server/datasources.json#L7 and want to change based on that then you may edit model-config.json like so:
{
    ...
    "User": {
        "dataSource": "elasticsearch-plain"
    },
    "AccessToken": {
        "dataSource": "elasticsearch-plain",
        ...
    },
    "ACL": {
        "dataSource": "elasticsearch-plain",
        ...
    },
    "RoleMapping": {
        "dataSource": "elasticsearch-plain",
        ...
    },
    "Role": {
        "dataSource": "elasticsearch-plain",
        ...
    },
    "UserModel": {
        "dataSource": "elasticsearch-plain"
    }
}
Why aren't multiple indexes supported or why is the name of ONE index required for the setup? Seems strange to me.
When the project started, the simplistic thinking was:
- one 
indexin ES is similar to one database in mongodb - one 
typein ES is similar to one collection in mongodb 
ES usecases are bound to be more diverse than that, so the connector too should evolve.
Issue #47 is an example where a community user attemtps to offer a solution and discussion is ongoing at the moment.
Multiple indexes supported since release v1.1.0. But please be aware that dynamix indexes: Issue #47 are still different and more advanced and not implemented.