quandl-elasticsearch 2.1.0.rc5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +20 -0
  3. data/.rubocop.yml +34 -0
  4. data/COMMANDS.md +29 -0
  5. data/Gemfile +10 -0
  6. data/Gemfile.lock +155 -0
  7. data/LICENSE.txt +22 -0
  8. data/README.md +50 -0
  9. data/Rakefile +1 -0
  10. data/config/elasticsearch.yml +32 -0
  11. data/elasticsearch/elasticsearch.yml +386 -0
  12. data/elasticsearch/logging.yml +56 -0
  13. data/elasticsearch/stopwords/english.txt +38 -0
  14. data/elasticsearch/synonyms/synonyms_english.txt +318 -0
  15. data/fixtures/vcr_cassettes/search_spec_database_1.yml +38 -0
  16. data/fixtures/vcr_cassettes/search_spec_database_2.yml +38 -0
  17. data/fixtures/vcr_cassettes/search_spec_dataset_1.yml +48 -0
  18. data/fixtures/vcr_cassettes/search_spec_dataset_2.yml +41 -0
  19. data/fixtures/vcr_cassettes/setup.yml +139 -0
  20. data/lib/quandl/elasticsearch.rb +61 -0
  21. data/lib/quandl/elasticsearch/base.rb +20 -0
  22. data/lib/quandl/elasticsearch/database.rb +22 -0
  23. data/lib/quandl/elasticsearch/dataset.rb +51 -0
  24. data/lib/quandl/elasticsearch/indice.rb +96 -0
  25. data/lib/quandl/elasticsearch/query.rb +282 -0
  26. data/lib/quandl/elasticsearch/search.rb +150 -0
  27. data/lib/quandl/elasticsearch/tag.rb +21 -0
  28. data/lib/quandl/elasticsearch/template.rb +189 -0
  29. data/lib/quandl/elasticsearch/utility.rb +6 -0
  30. data/lib/quandl/elasticsearch/version.rb +6 -0
  31. data/quandl +77 -0
  32. data/quandl-elasticsearch.gemspec +34 -0
  33. data/solano.yml +20 -0
  34. data/spec/lib/quandl/elasticsearch/database_spec.rb +98 -0
  35. data/spec/lib/quandl/elasticsearch/dataset_spec.rb +124 -0
  36. data/spec/lib/quandl/elasticsearch/indice_spec.rb +10 -0
  37. data/spec/lib/quandl/elasticsearch/query_spec.rb +239 -0
  38. data/spec/lib/quandl/elasticsearch/search_spec.rb +83 -0
  39. data/spec/lib/quandl/elasticsearch/template_spec.rb +182 -0
  40. data/spec/lib/quandl/elasticsearch/utility_spec.rb +10 -0
  41. data/spec/lib/quandl/elasticsearch_spec.rb +99 -0
  42. data/spec/spec_helper.rb +27 -0
  43. data/templates/database_mapping.json +11 -0
  44. data/templates/dataset_mapping.json +9 -0
  45. data/templates/quandl_delimiter.json +0 -0
  46. data/templates/search_term_mapping.json +13 -0
  47. data/tests/Database-Ratings.csv +405 -0
  48. data/tests/Database-Tags.csv +341 -0
  49. data/tests/compare.csv +1431 -0
  50. data/tests/compare.rb +33 -0
  51. data/tests/console.rb +4 -0
  52. data/tests/generated_db_tags.csv +341 -0
  53. data/tests/search.rb +14 -0
  54. data/tests/search_db_mapping.txt +402 -0
  55. data/tests/status.rb +2 -0
  56. data/tests/test_search.csv +87 -0
  57. data/tests/test_search.rb +113 -0
  58. data/tests/testing-list.txt +183 -0
  59. data/tests/top500searches.csv +477 -0
  60. metadata +300 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 051c86c13aec9cbf60a22eb5041f00b1a19c9e6d
4
+ data.tar.gz: aaf9130e2b2a593541b7a7ed9156df090ce9af87
5
+ SHA512:
6
+ metadata.gz: 55bbc7c678c0ccaf57d770e111d826f528f822fb548b1194a29934cd52bbdf7f8c10358de9bff4285165cba62a28ae0c5ac9e98dadc0e33d3023901fae6a9408
7
+ data.tar.gz: b2718d1df9ff33e08026db25010535b06b39d97197d8b6201aba4d79e9a74dd5daaff82eb542305d868df2bb3bdd4e01eec2e520db787612f0f97a710c2ebf5d
data/.gitignore ADDED
@@ -0,0 +1,20 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ InstalledFiles
7
+ _yardoc
8
+ coverage
9
+ doc/
10
+ lib/bundler/man
11
+ pkg
12
+ rdoc
13
+ spec/reports
14
+ test/tmp
15
+ test/version_tmp
16
+ tmp
17
+
18
+ /rubocop_result.txt
19
+ .ruby-version
20
+ .solano*
data/.rubocop.yml ADDED
@@ -0,0 +1,34 @@
1
+ AllCops:
2
+ Exclude:
3
+ - db/**/*
4
+ - config/boot.rb
5
+ - !ruby/regexp /rgloader/
6
+ - !ruby/regexp /.*tddium.*\.rb$/
7
+ - app/api/**/*
8
+ - tests/*
9
+ - Gemfile
10
+ DisplayCopNames: true
11
+ DisplayStyleGuide: true
12
+ LineLength:
13
+ Max: 180
14
+ Exclude:
15
+ - 'spec/**/*'
16
+ MethodLength:
17
+ Max: 40
18
+ Documentation:
19
+ Enabled: false
20
+ CyclomaticComplexity:
21
+ Enabled: false
22
+ ClassAndModuleChildren:
23
+ Enabled: false
24
+ Style/FileName:
25
+ Enabled: false
26
+ ClassLength:
27
+ Max: 200
28
+ PerceivedComplexity:
29
+ Enabled: false
30
+ AbcSize:
31
+ Enabled: false
32
+ Style/BlockDelimiters:
33
+ Exclude:
34
+ - 'spec/**/*'
data/COMMANDS.md ADDED
@@ -0,0 +1,29 @@
1
+ ## Command line
2
+ Make sure packages like git, ruby, bundler are installed in your box.
3
+
4
+ Go to your working folder:
5
+
6
+ git clone git@github.com:quandl/quandl-elasticsearch.git
7
+ cd quandl-elasticsearch
8
+ bundle install
9
+
10
+ Run following commands under quandl-elasticsearch folder to start your search:
11
+
12
+ ## search for 'stock price', showing page 0 by default (page 0 is the first page)
13
+ ./quandl search -q 'stock price'
14
+
15
+ ## search for 'bank' and show page 5 of search result.
16
+ ./quandl search -q 'bank' -p 5
17
+
18
+ ## show search results for page 2 and each page shows 25 results.
19
+ ./quandl search --q "oil" -p 2 -s 25
20
+
21
+ ## serch for databases with term aaple and with tags USA and STOCKS
22
+ ## tags supported:
23
+ ## STOCKS BONDS COMMODITIES CURRENCIES FUTURES OPTIONS INDEXES ESTIMATES FUNDAMENTALS ALTERNATIVES GLOBAL USA EUROPE
24
+ ## BRICS ROW MARKETS ECONOMICS SOCIETY DEMOGRAPHY ENERGY HEALTH EDUCATION AGRICULTURE INDUSTRY HOUSING LABOUR CENTRALBANKS
25
+ ## STATISTICALAGENCIES EXCHANGES PRIVATEFIRMS MULTINATIONALS UNIVERSITIES
26
+ ./quandl_es search --q "aapl" -g 'USA,STOCKS'
27
+
28
+ ## for more info about search command
29
+ ./quandl search --help
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in quandl-elasticsearch.gemspec
4
+ gemspec
5
+
6
+ gem 'thor', '0.19.1'
7
+
8
+ group :debug do
9
+ gem 'solano'
10
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,155 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ quandl-elasticsearch (2.1.0.rc2)
5
+ commander (~> 4.3)
6
+ elasticsearch (~> 1.0.17)
7
+ json (~> 1.8.2)
8
+ quandl-config (> 0.0.3, < 2.0)
9
+
10
+ GEM
11
+ remote: https://rubygems.org/
12
+ specs:
13
+ activesupport (4.2.4)
14
+ i18n (~> 0.7)
15
+ json (~> 1.7, >= 1.7.7)
16
+ minitest (~> 5.1)
17
+ thread_safe (~> 0.3, >= 0.3.4)
18
+ tzinfo (~> 1.1)
19
+ addressable (2.3.8)
20
+ ast (2.1.0)
21
+ astrolabe (1.3.1)
22
+ parser (~> 2.2)
23
+ coderay (1.1.0)
24
+ commander (4.4.0)
25
+ highline (~> 1.7.2)
26
+ crack (0.4.2)
27
+ safe_yaml (~> 1.0.0)
28
+ descendants_tracker (0.0.4)
29
+ thread_safe (~> 0.3, >= 0.3.1)
30
+ diff-lcs (1.2.5)
31
+ docile (1.1.5)
32
+ elasticsearch (1.0.17)
33
+ elasticsearch-api (= 1.0.17)
34
+ elasticsearch-transport (= 1.0.17)
35
+ elasticsearch-api (1.0.17)
36
+ multi_json
37
+ elasticsearch-transport (1.0.17)
38
+ faraday
39
+ multi_json
40
+ faraday (0.9.2)
41
+ multipart-post (>= 1.2, < 3)
42
+ github_api (0.12.4)
43
+ addressable (~> 2.3)
44
+ descendants_tracker (~> 0.0.4)
45
+ faraday (~> 0.8, < 0.10)
46
+ hashie (>= 3.4)
47
+ multi_json (>= 1.7.5, < 2.0)
48
+ nokogiri (~> 1.6.6)
49
+ oauth2
50
+ hashdiff (0.2.2)
51
+ hashie (3.4.3)
52
+ highline (1.7.8)
53
+ httpclient (2.6.0.1)
54
+ i18n (0.7.0)
55
+ json (1.8.3)
56
+ jwt (1.5.2)
57
+ launchy (2.4.3)
58
+ addressable (~> 2.3)
59
+ method_source (0.8.2)
60
+ mini_portile (0.6.2)
61
+ minitest (5.8.2)
62
+ multi_json (1.11.2)
63
+ multi_xml (0.5.5)
64
+ multipart-post (2.0.0)
65
+ nayutaya-msgpack-pure (0.0.2)
66
+ nokogiri (1.6.6.2)
67
+ mini_portile (~> 0.6.0)
68
+ oauth2 (1.0.0)
69
+ faraday (>= 0.8, < 0.10)
70
+ jwt (~> 1.0)
71
+ multi_json (~> 1.3)
72
+ multi_xml (~> 0.5)
73
+ rack (~> 1.2)
74
+ parser (2.2.3.0)
75
+ ast (>= 1.1, < 3.0)
76
+ powerpack (0.1.1)
77
+ pry (0.10.3)
78
+ coderay (~> 1.1.0)
79
+ method_source (~> 0.8.1)
80
+ slop (~> 3.4)
81
+ quandl-config (0.1.0)
82
+ activesupport
83
+ rack (1.6.4)
84
+ rainbow (2.0.0)
85
+ rake (10.4.2)
86
+ rspec (3.3.0)
87
+ rspec-core (~> 3.3.0)
88
+ rspec-expectations (~> 3.3.0)
89
+ rspec-mocks (~> 3.3.0)
90
+ rspec-core (3.3.2)
91
+ rspec-support (~> 3.3.0)
92
+ rspec-expectations (3.3.1)
93
+ diff-lcs (>= 1.2.0, < 2.0)
94
+ rspec-support (~> 3.3.0)
95
+ rspec-mocks (3.3.2)
96
+ diff-lcs (>= 1.2.0, < 2.0)
97
+ rspec-support (~> 3.3.0)
98
+ rspec-support (3.3.0)
99
+ rubocop (0.34.2)
100
+ astrolabe (~> 1.3)
101
+ parser (>= 2.2.2.5, < 3.0)
102
+ powerpack (~> 0.1)
103
+ rainbow (>= 1.99.1, < 3.0)
104
+ ruby-progressbar (~> 1.4)
105
+ rubocopter (0.1.6)
106
+ rubocop (>= 0.30.1)
107
+ ruby-progressbar (1.7.5)
108
+ safe_yaml (1.0.4)
109
+ simplecov (0.10.0)
110
+ docile (~> 1.1.0)
111
+ json (~> 1.8)
112
+ simplecov-html (~> 0.10.0)
113
+ simplecov-html (0.10.0)
114
+ slop (3.6.0)
115
+ solano (1.27.7)
116
+ addressable (~> 2.3)
117
+ github_api (~> 0.12)
118
+ highline (~> 1.6)
119
+ json (~> 1.8)
120
+ launchy (~> 2.4)
121
+ nayutaya-msgpack-pure (~> 0.0, >= 0.0.2)
122
+ tddium_client (~> 0.5, >= 0.5.2)
123
+ thor (~> 0.19)
124
+ tddium_client (0.5.2)
125
+ httpclient (>= 2.2.5)
126
+ json
127
+ thor (0.19.1)
128
+ thread_safe (0.3.5)
129
+ tzinfo (1.2.2)
130
+ thread_safe (~> 0.1)
131
+ vcr (3.0.0)
132
+ webmock (1.22.3)
133
+ addressable (>= 2.3.6)
134
+ crack (>= 0.3.2)
135
+ hashdiff
136
+
137
+ PLATFORMS
138
+ ruby
139
+
140
+ DEPENDENCIES
141
+ activesupport
142
+ bundler (~> 1.3)
143
+ pry
144
+ quandl-elasticsearch!
145
+ rake
146
+ rspec
147
+ rubocopter
148
+ simplecov
149
+ solano
150
+ thor (= 0.19.1)
151
+ vcr
152
+ webmock
153
+
154
+ BUNDLED WITH
155
+ 1.12.5
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Jun Li
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,50 @@
1
+ # Quandl::Elasticsearch
2
+
3
+ [![](https://ci.solanolabs.com:443/Quandl/quandl-elasticsearch/badges/211250.png?badge_token=50ac95382361a77a9b82048dfad838fc8757683e)](https://ci.solanolabs.com:443/Quandl/quandl-elasticsearch/suites/211250)
4
+
5
+ ## Description
6
+ Customized quandl search, indexes, schemas functions against [elasticsearch server](https://www.elastic.co/products/elasticsearch). The underline elasticsearch API calls is based on [elasticsearch-ruby](https://github.com/elastic/elasticsearch-ruby). Main search queres is built on [parent-child indexs](https://www.elastic.co/guide/en/elasticsearch/guide/current/indexing-parent-child.html)
7
+
8
+ ## Development Setup
9
+ - use wikiposit docker image for [local elastcisearch server setup](https://github.com/quandl/wikiposit#re-index-elastic-search)
10
+ - use the elasticsearch local server ip from above and update it at ./config/elasticsearch.yml
11
+ - run follow command to quandl elasticsearch console
12
+ ```ruby
13
+ bundle exec ruby ./test/console.rb
14
+ ```
15
+
16
+ ## Deployment
17
+ 1. build gem
18
+ ```bash
19
+ gem build quandl-elasticsearch.gemspec
20
+ ```
21
+ 2. upload gem to https://gemfury.com/ quandl account
22
+ 3. in your gemfile include this
23
+ ```ruby
24
+ source 'https://GEM-FURY-KEY@gem.fury.io/quandl/' do
25
+ gem 'quandl-elasticsearch'
26
+ end
27
+ ```
28
+
29
+ ## Command lines for testing
30
+ [command line usages](../COMMANDS.md)
31
+
32
+
33
+ ## Configuration
34
+
35
+ The default configuration is taken from the elasticsearch.yml file in this project. To override in your project use the 'configure' method:
36
+
37
+ ```ruby
38
+ Quandl::Elasticsearch.configure do |config|
39
+ config.host = 'HOST_IP'
40
+ end
41
+ ```
42
+
43
+ The only options that can be overriden is 'host'.
44
+
45
+ ## Quick start with Elasticsearch
46
+ - [Elasticsearch: The Definiteive Guide](https://www.elastic.co/guide/en/elasticsearch/guide/current/index.html)
47
+ - [Elasticsearch API Reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html)
48
+ - [elasticsearch-ruby](https://github.com/elastic/elasticsearch-ruby) and [documentation](http://www.rubydoc.info/gems/elasticsearch-api/Elasticsearch/API)
49
+
50
+
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
@@ -0,0 +1,32 @@
1
+ default: &defaults
2
+ host: 'http://staging-search.quandl.com:9200/'
3
+ # see https://github.com/lostisland/faraday/tree/v0.9.2#usage
4
+ timeout: ~
5
+ open_timeout: ~
6
+ api_timeout: ~
7
+
8
+ staging:
9
+ <<: *defaults
10
+
11
+ old_staging:
12
+ <<: *defaults
13
+ host: 'http://54.163.90.15:9200/'
14
+
15
+ vagrant:
16
+ <<: *defaults
17
+
18
+ vagrant_test:
19
+ <<: *defaults
20
+
21
+ development:
22
+ <<: *defaults
23
+
24
+ test:
25
+ <<: *defaults
26
+ timeout: 10
27
+ open_timeout: 1
28
+ api_timeout: 10
29
+
30
+ production:
31
+ <<: *defaults
32
+ host: 'prod-search.quandl.com:9200'
@@ -0,0 +1,386 @@
1
+ ##################### Elasticsearch Configuration Example #####################
2
+
3
+ # This file contains an overview of various configuration settings,
4
+ # targeted at operations staff. Application developers should
5
+ # consult the guide at <http://elasticsearch.org/guide>.
6
+ #
7
+ # The installation procedure is covered at
8
+ # <http://elasticsearch.org/guide/en/elasticsearch/reference/current/setup.html>.
9
+ #
10
+ # Elasticsearch comes with reasonable defaults for most settings,
11
+ # so you can try it out without bothering with configuration.
12
+ #
13
+ # Most of the time, these defaults are just fine for running a production
14
+ # cluster. If you're fine-tuning your cluster, or wondering about the
15
+ # effect of certain configuration option, please _do ask_ on the
16
+ # mailing list or IRC channel [http://elasticsearch.org/community].
17
+
18
+ # Any element in the configuration can be replaced with environment variables
19
+ # by placing them in ${...} notation. For example:
20
+ #
21
+ #node.rack: ${RACK_ENV_VAR}
22
+
23
+ # For information on supported formats and syntax for the config file, see
24
+ # <http://elasticsearch.org/guide/en/elasticsearch/reference/current/setup-configuration.html>
25
+
26
+
27
+ ################################### Cluster ###################################
28
+
29
+ # Cluster name identifies your cluster for auto-discovery. If you're running
30
+ # multiple clusters on the same network, make sure you're using unique names.
31
+ #
32
+ cluster.name: staging-elasticsearch
33
+
34
+
35
+ #################################### Node #####################################
36
+
37
+ # Node names are generated dynamically on startup, so you're relieved
38
+ # from configuring them manually. You can tie this node to a specific name:
39
+ #
40
+ #node.name: "Franz Kafka"
41
+
42
+ # Every node can be configured to allow or deny being eligible as the master,
43
+ # and to allow or deny to store the data.
44
+ #
45
+ # Allow this node to be eligible as a master node (enabled by default):
46
+ #
47
+ #node.master: true
48
+ #
49
+ # Allow this node to store data (enabled by default):
50
+ #
51
+ #node.data: true
52
+
53
+ # You can exploit these settings to design advanced cluster topologies.
54
+ #
55
+ # 1. You want this node to never become a master node, only to hold data.
56
+ # This will be the "workhorse" of your cluster.
57
+ #
58
+ #node.master: false
59
+ #node.data: true
60
+ #
61
+ # 2. You want this node to only serve as a master: to not store any data and
62
+ # to have free resources. This will be the "coordinator" of your cluster.
63
+ #
64
+ #node.master: true
65
+ #node.data: false
66
+ #
67
+ # 3. You want this node to be neither master nor data node, but
68
+ # to act as a "search load balancer" (fetching data from nodes,
69
+ # aggregating results, etc.)
70
+ #
71
+ #node.master: false
72
+ #node.data: false
73
+
74
+ # Use the Cluster Health API [http://localhost:9200/_cluster/health], the
75
+ # Node Info API [http://localhost:9200/_nodes] or GUI tools
76
+ # such as <http://www.elasticsearch.org/overview/marvel/>,
77
+ # <http://github.com/karmi/elasticsearch-paramedic>,
78
+ # <http://github.com/lukas-vlcek/bigdesk> and
79
+ # <http://mobz.github.com/elasticsearch-head> to inspect the cluster state.
80
+
81
+ # A node can have generic attributes associated with it, which can later be used
82
+ # for customized shard allocation filtering, or allocation awareness. An attribute
83
+ # is a simple key value pair, similar to node.key: value, here is an example:
84
+ #
85
+ #node.rack: rack314
86
+
87
+ # By default, multiple nodes are allowed to start from the same installation location
88
+ # to disable it, set the following:
89
+ #node.max_local_storage_nodes: 1
90
+
91
+
92
+ #################################### Index ####################################
93
+
94
+ # You can set a number of options (such as shard/replica options, mapping
95
+ # or analyzer definitions, translog settings, ...) for indices globally,
96
+ # in this file.
97
+ #
98
+ # Note, that it makes more sense to configure index settings specifically for
99
+ # a certain index, either when creating it or by using the index templates API.
100
+ #
101
+ # See <http://elasticsearch.org/guide/en/elasticsearch/reference/current/index-modules.html> and
102
+ # <http://elasticsearch.org/guide/en/elasticsearch/reference/current/indices-create-index.html>
103
+ # for more information.
104
+
105
+ # Set the number of shards (splits) of an index (5 by default):
106
+ #
107
+ index.number_of_shards: 1
108
+
109
+ # Set the number of replicas (additional copies) of an index (1 by default):
110
+ #
111
+ index.number_of_replicas: 1
112
+
113
+ # Note, that for development on a local machine, with small indices, it usually
114
+ # makes sense to "disable" the distributed features:
115
+ #
116
+ index.number_of_shards: 0
117
+ #index.number_of_replicas: 0
118
+
119
+ # These settings directly affect the performance of index and search operations
120
+ # in your cluster. Assuming you have enough machines to hold shards and
121
+ # replicas, the rule of thumb is:
122
+ #
123
+ # 1. Having more *shards* enhances the _indexing_ performance and allows to
124
+ # _distribute_ a big index across machines.
125
+ # 2. Having more *replicas* enhances the _search_ performance and improves the
126
+ # cluster _availability_.
127
+ #
128
+ # The "number_of_shards" is a one-time setting for an index.
129
+ #
130
+ # The "number_of_replicas" can be increased or decreased anytime,
131
+ # by using the Index Update Settings API.
132
+ #
133
+ # Elasticsearch takes care about load balancing, relocating, gathering the
134
+ # results from nodes, etc. Experiment with different settings to fine-tune
135
+ # your setup.
136
+
137
+ # Use the Index Status API (<http://localhost:9200/A/_status>) to inspect
138
+ # the index status.
139
+
140
+
141
+ #################################### Paths ####################################
142
+
143
+ # Path to directory containing configuration (this file and logging.yml):
144
+ #
145
+ #path.conf: /path/to/conf
146
+
147
+ # Path to directory where to store index data allocated for this node.
148
+ #
149
+ #path.data: /path/to/data
150
+ #
151
+ # Can optionally include more than one location, causing data to be striped across
152
+ # the locations (a la RAID 0) on a file level, favouring locations with most free
153
+ # space on creation. For example:
154
+ #
155
+ #path.data: /path/to/data1,/path/to/data2
156
+
157
+ # Path to temporary files:
158
+ #
159
+ #path.work: /path/to/work
160
+
161
+ # Path to log files:
162
+ #
163
+ #path.logs: /path/to/logs
164
+
165
+ # Path to where plugins are installed:
166
+ #
167
+ #path.plugins: /path/to/plugins
168
+
169
+
170
+ #################################### Plugin ###################################
171
+
172
+ # If a plugin listed here is not installed for current node, the node will not start.
173
+ #
174
+ #plugin.mandatory: mapper-attachments,lang-groovy
175
+
176
+
177
+ ################################### Memory ####################################
178
+
179
+ # Elasticsearch performs poorly when JVM starts swapping: you should ensure that
180
+ # it _never_ swaps.
181
+ #
182
+ # Set this property to true to lock the memory:
183
+ #
184
+ #bootstrap.mlockall: true
185
+
186
+ # Make sure that the ES_MIN_MEM and ES_MAX_MEM environment variables are set
187
+ # to the same value, and that the machine has enough memory to allocate
188
+ # for Elasticsearch, leaving enough memory for the operating system itself.
189
+ #
190
+ # You should also make sure that the Elasticsearch process is allowed to lock
191
+ # the memory, eg. by using `ulimit -l unlimited`.
192
+
193
+
194
+ ############################## Network And HTTP ###############################
195
+
196
+ # Elasticsearch, by default, binds itself to the 0.0.0.0 address, and listens
197
+ # on port [9200-9300] for HTTP traffic and on port [9300-9400] for node-to-node
198
+ # communication. (the range means that if the port is busy, it will automatically
199
+ # try the next port).
200
+
201
+ # Set the bind address specifically (IPv4 or IPv6):
202
+ #
203
+ #network.bind_host: 192.168.0.1
204
+
205
+ # Set the address other nodes will use to communicate with this node. If not
206
+ # set, it is automatically derived. It must point to an actual IP address.
207
+ #
208
+ #network.publish_host: 192.168.0.1
209
+
210
+ # Set both 'bind_host' and 'publish_host':
211
+ #
212
+ #network.host: 192.168.0.1
213
+
214
+ # Set a custom port for the node to node communication (9300 by default):
215
+ #
216
+ #transport.tcp.port: 9300
217
+
218
+ # Enable compression for all communication between nodes (disabled by default):
219
+ #
220
+ #transport.tcp.compress: true
221
+
222
+ # Set a custom port to listen for HTTP traffic:
223
+ #
224
+ #http.port: 9200
225
+
226
+ # Set a custom allowed content length:
227
+ #
228
+ #http.max_content_length: 100mb
229
+
230
+ # Disable HTTP completely:
231
+ #
232
+ #http.enabled: false
233
+
234
+
235
+ ################################### Gateway ###################################
236
+
237
+ # The gateway allows for persisting the cluster state between full cluster
238
+ # restarts. Every change to the state (such as adding an index) will be stored
239
+ # in the gateway, and when the cluster starts up for the first time,
240
+ # it will read its state from the gateway.
241
+
242
+ # There are several types of gateway implementations. For more information, see
243
+ # <http://elasticsearch.org/guide/en/elasticsearch/reference/current/modules-gateway.html>.
244
+
245
+ # The default gateway type is the "local" gateway (recommended):
246
+ #
247
+ #gateway.type: local
248
+
249
+ # Settings below control how and when to start the initial recovery process on
250
+ # a full cluster restart (to reuse as much local data as possible when using shared
251
+ # gateway).
252
+
253
+ # Allow recovery process after N nodes in a cluster are up:
254
+ #
255
+ #gateway.recover_after_nodes: 1
256
+
257
+ # Set the timeout to initiate the recovery process, once the N nodes
258
+ # from previous setting are up (accepts time value):
259
+ #
260
+ #gateway.recover_after_time: 5m
261
+
262
+ # Set how many nodes are expected in this cluster. Once these N nodes
263
+ # are up (and recover_after_nodes is met), begin recovery process immediately
264
+ # (without waiting for recover_after_time to expire):
265
+ #
266
+ #gateway.expected_nodes: 2
267
+
268
+
269
+ ############################# Recovery Throttling #############################
270
+
271
+ # These settings allow to control the process of shards allocation between
272
+ # nodes during initial recovery, replica allocation, rebalancing,
273
+ # or when adding and removing nodes.
274
+
275
+ # Set the number of concurrent recoveries happening on a node:
276
+ #
277
+ # 1. During the initial recovery
278
+ #
279
+ #cluster.routing.allocation.node_initial_primaries_recoveries: 4
280
+ #
281
+ # 2. During adding/removing nodes, rebalancing, etc
282
+ #
283
+ #cluster.routing.allocation.node_concurrent_recoveries: 2
284
+
285
+ # Set to throttle throughput when recovering (eg. 100mb, by default 20mb):
286
+ #
287
+ indices.recovery.max_bytes_per_sec: 200mb
288
+ indices.store.throttle.type: none
289
+
290
+ # Set to limit the number of open concurrent streams when
291
+ # recovering a shard from a peer:
292
+ #
293
+ #indices.recovery.concurrent_streams: 5
294
+
295
+
296
+ ################################## Discovery ##################################
297
+
298
+ # Discovery infrastructure ensures nodes can be found within a cluster
299
+ # and master node is elected. Multicast discovery is the default.
300
+
301
+ # Set to ensure a node sees N other master eligible nodes to be considered
302
+ # operational within the cluster. This should be set to a quorum/majority of
303
+ # the master-eligible nodes in the cluster.
304
+ #
305
+ #discovery.zen.minimum_master_nodes: 1
306
+
307
+ # Set the time to wait for ping responses from other nodes when discovering.
308
+ # Set this option to a higher value on a slow or congested network
309
+ # to minimize discovery failures:
310
+ #
311
+ #discovery.zen.ping.timeout: 3s
312
+
313
+ # For more information, see
314
+ # <http://elasticsearch.org/guide/en/elasticsearch/reference/current/modules-discovery-zen.html>
315
+
316
+ # Unicast discovery allows to explicitly control which nodes will be used
317
+ # to discover the cluster. It can be used when multicast is not present,
318
+ # or to restrict the cluster communication-wise.
319
+ #
320
+ # 1. Disable multicast discovery (enabled by default):
321
+ #
322
+ #discovery.zen.ping.multicast.enabled: false
323
+ #
324
+ # 2. Configure an initial list of master nodes in the cluster
325
+ # to perform discovery when new nodes (master or data) are started:
326
+ #
327
+ #discovery.zen.ping.unicast.hosts: ["host1", "host2:port"]
328
+
329
+ # EC2 discovery allows to use AWS EC2 API in order to perform discovery.
330
+ #
331
+ # You have to install the cloud-aws plugin for enabling the EC2 discovery.
332
+ #
333
+ # For more information, see
334
+ # <http://elasticsearch.org/guide/en/elasticsearch/reference/current/modules-discovery-ec2.html>
335
+ #
336
+ # See <http://elasticsearch.org/tutorials/elasticsearch-on-ec2/>
337
+ # for a step-by-step tutorial.
338
+
339
+ # GCE discovery allows to use Google Compute Engine API in order to perform discovery.
340
+ #
341
+ # You have to install the cloud-gce plugin for enabling the GCE discovery.
342
+ #
343
+ # For more information, see <https://github.com/elasticsearch/elasticsearch-cloud-gce>.
344
+
345
+ # Azure discovery allows to use Azure API in order to perform discovery.
346
+ #
347
+ # You have to install the cloud-azure plugin for enabling the Azure discovery.
348
+ #
349
+ # For more information, see <https://github.com/elasticsearch/elasticsearch-cloud-azure>.
350
+
351
+ ################################## Slow Log ##################################
352
+
353
+ # Shard level query and fetch threshold logging.
354
+
355
+ #index.search.slowlog.threshold.query.warn: 10s
356
+ #index.search.slowlog.threshold.query.info: 5s
357
+ #index.search.slowlog.threshold.query.debug: 2s
358
+ #index.search.slowlog.threshold.query.trace: 500ms
359
+
360
+ #index.search.slowlog.threshold.fetch.warn: 1s
361
+ #index.search.slowlog.threshold.fetch.info: 800ms
362
+ #index.search.slowlog.threshold.fetch.debug: 500ms
363
+ #index.search.slowlog.threshold.fetch.trace: 200ms
364
+
365
+ #index.indexing.slowlog.threshold.index.warn: 10s
366
+ #index.indexing.slowlog.threshold.index.info: 5s
367
+ #index.indexing.slowlog.threshold.index.debug: 2s
368
+ #index.indexing.slowlog.threshold.index.trace: 500ms
369
+
370
+ ################################## GC Logging ################################
371
+
372
+ #monitor.jvm.gc.young.warn: 1000ms
373
+ #monitor.jvm.gc.young.info: 700ms
374
+ #monitor.jvm.gc.young.debug: 400ms
375
+
376
+ #monitor.jvm.gc.old.warn: 10s
377
+ #monitor.jvm.gc.old.info: 5s
378
+ #monitor.jvm.gc.old.debug: 2s
379
+
380
+ ################################## Security ################################
381
+
382
+ # Uncomment if you want to enable JSONP as a valid return transport on the
383
+ # http server. With this enabled, it may pose a security risk, so disabling
384
+ # it unless you need it is recommended (it is disabled by default).
385
+ #
386
+ #http.jsonp.enable: true