koopjs / koop-provider-elasticsearch

A provider for koop that can connect to one or more elastic search instances and turn indices/aliases into individual feature services.
Apache License 2.0
13 stars 4 forks source link

appConfig.json #6

Closed keithfraley closed 6 years ago

keithfraley commented 6 years ago

I want to hightlight a couple key points / issues we have run into.

  1. You do not need to add the geometry field into the returnfields array

  2. In order to get the URL route to correctly resolve we currently have to name the esConnection, id and index the same name.

    "esConnections": { "master": { "id": "master", "protocol": "http://", "port": 9200, "hosts": [ "localhost" ], "indices": [{ "index": "master", "maxResults": 10000, "geometryField": "geometry", "geometryType": "geo_point", "returnFields": [

  3. You do need to add the date field in both returnfields and dateFields array.

keithfraley commented 6 years ago

TypeError: Cannot read property 'indices' of undefined at getIndexConfig (/provider/models/esmodel.js:171:32) at ThisModel.getData (/provider/models/esmodel.js:18:27) at /node_modules/koop/dist/models/index.js:13:14 at Cache.retrieve (/node_modules/koop-cache-memory/dist/index.js:75:38) at ThisModel.Model.pull (node_modules/koop/dist/models/index.js:9:14) at Controller.Geoservices.featureServer (node_modules/koop-output-geoservices/index.js:7:14) at Layer.handle [as handle_request] (node_modules/express/lib/router/layer.js:95:5) at next (node_modules/express/lib/router/route.js:137:13) at Route.dispatch (node_modules/express/lib/router/route.js:112:3) at Layer.handle [as handle_request] (node_modules/express/lib/router/layer.js:95:5)

this is what I get when I try and use the clusterID in the url

dhatcher commented 6 years ago

You shouldn't need to have the first two set to master. They can be anything as long as they match. We run dozens of indices within one cluster config and none of them are named the same as the cluster/clusterid. The first two do have to be the same though.

keithfraley commented 6 years ago

perfect, this works, thanks!