Skip to content

Commit

Permalink
Add default Elasticsearch settings
Browse files Browse the repository at this point in the history
These were buried in pelias/schema (https://github.com/pelias/schema/blob/f28002db187f1685abc3688b141e0bfdd5cdd01a/settings.js#L289-L296),
so by moving them here it's more obvious they can be overridden.

We use 1 shard as a default in development where scalability isn't
required.

Also, because we use the [dfs_query_then_fetch](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-search-type.html#dfs-query-then-fetch)
search mode, having one shard eliminates any possibility of queries run
_without_ that setting having confusing results due to TF/IDF

The `index_concurrency` setting is set to 10 as an attempt to increase
indexing performance as well.

Reference:
https://github.com/pelias/api/blob/9ff383cc2b4a690fa05a88e70c598bfdc28751f4/controller/search.js#L44
https://www.elastic.co/guide/en/elasticsearch/guide/current/relevance-is-broken.html

Connects pelias/schema#178
  • Loading branch information
orangejulius committed Oct 17, 2016
1 parent 14b4aca commit 0e3fd2c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions config/defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@
"level": [ "error", "warning" ]
}]
},
"elasticsearch": {
"settings": {
"index": {
"number_of_replicas": "0",
"number_of_shards": "1",
"index_concurrency": "10"
}
}
},
"dbclient": {
"statFrequency": 10000
},
Expand Down
9 changes: 9 additions & 0 deletions config/expected-deep.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@
"level": [ "error", "warning" ]
}]
},
"elasticsearch": {
"settings": {
"index": {
"number_of_replicas": "0",
"number_of_shards": "1",
"index_concurrency": "10"
}
}
},
"dbclient": {
"statFrequency": 10000
},
Expand Down

0 comments on commit 0e3fd2c

Please sign in to comment.