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
@@ -0,0 +1,56 @@
1
+ # you can override this using by setting a system property, for example -Des.logger.level=DEBUG
2
+ es.logger.level: INFO
3
+ rootLogger: ${es.logger.level}, console, file
4
+ logger:
5
+ # log action execution errors for easier debugging
6
+ action: DEBUG
7
+ # reduce the logging for aws, too much is logged under the default INFO
8
+ com.amazonaws: WARN
9
+
10
+ # gateway
11
+ #gateway: DEBUG
12
+ #index.gateway: DEBUG
13
+
14
+ # peer shard recovery
15
+ #indices.recovery: DEBUG
16
+
17
+ # discovery
18
+ #discovery: TRACE
19
+
20
+ index.search.slowlog: TRACE, index_search_slow_log_file
21
+ index.indexing.slowlog: TRACE, index_indexing_slow_log_file
22
+
23
+ additivity:
24
+ index.search.slowlog: false
25
+ index.indexing.slowlog: false
26
+
27
+ appender:
28
+ console:
29
+ type: console
30
+ layout:
31
+ type: consolePattern
32
+ conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n"
33
+
34
+ file:
35
+ type: dailyRollingFile
36
+ file: ${path.logs}/${cluster.name}.log
37
+ datePattern: "'.'yyyy-MM-dd"
38
+ layout:
39
+ type: pattern
40
+ conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n"
41
+
42
+ index_search_slow_log_file:
43
+ type: dailyRollingFile
44
+ file: ${path.logs}/${cluster.name}_index_search_slowlog.log
45
+ datePattern: "'.'yyyy-MM-dd"
46
+ layout:
47
+ type: pattern
48
+ conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n"
49
+
50
+ index_indexing_slow_log_file:
51
+ type: dailyRollingFile
52
+ file: ${path.logs}/${cluster.name}_index_indexing_slowlog.log
53
+ datePattern: "'.'yyyy-MM-dd"
54
+ layout:
55
+ type: pattern
56
+ conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n"
@@ -0,0 +1,38 @@
1
+ stopworda
2
+ stopwordb
3
+
4
+ a
5
+ an
6
+ and
7
+ are
8
+ as
9
+ at
10
+ be
11
+ but
12
+ by
13
+ for
14
+ if
15
+ in
16
+ into
17
+ is
18
+ it
19
+ no
20
+ not
21
+ of
22
+ on
23
+ or
24
+ s
25
+ such
26
+ t
27
+ that
28
+ the
29
+ their
30
+ then
31
+ there
32
+ these
33
+ they
34
+ this
35
+ to
36
+ was
37
+ will
38
+ with
@@ -0,0 +1,318 @@
1
+ #test case
2
+ one random number, abcdef
3
+
4
+ # miscellaneous, domainspecific, added by hand
5
+ cpi, consumer price index, inflation
6
+ ppi, producer price index
7
+ gdp, gross domestic product
8
+ gnp, gross national product
9
+ one, 1
10
+ two, 2
11
+ three, 3
12
+ four, 4
13
+ five, 5
14
+ six, 6
15
+ seven, 7
16
+ eight, 8
17
+ nine, 9
18
+ ten, 10
19
+ fx_syn, foreign exchange, fx, forex, exchange rate
20
+ home_syn, home, house, property, real estate, housing
21
+ index, indice
22
+ equity, stock, share, shares
23
+ interest_rate_syn, yield, interest rate, bond rate, bill rate, note rate
24
+ maize, corn
25
+ aluminum, aluminium
26
+ sulphur, sulfur
27
+ use, usage
28
+ e commerce, ecommerce
29
+ ords, ordinaries
30
+ yr, year
31
+ centre, center
32
+ labor, labour
33
+ spx, s&p500, s&p 500
34
+ aids, hiv
35
+
36
+ un, united nations
37
+ fao, food and agriculture organization
38
+ iaea, international atomic energy agency
39
+ ilo, international labour organization
40
+ unesco, united nations educational scientific and cultural organization
41
+ unido, united nations industrial development organization
42
+ who, world health organization
43
+ wto, world trade organization
44
+ imf, international monetary fund
45
+ wb, world bank
46
+ eu, european union
47
+ nato, north atlantic treaty organization
48
+ asean, association of south east asian nations
49
+ oecd, organization for economic cooperation and development
50
+ opec, organization of the petroleum exporting countries
51
+ wwf, world wide fund for nature
52
+ unicef, united nations children's fund
53
+ wfp, world food programme
54
+ osce, organization for security and cooperation in europe
55
+ icrc, international committee of the red cross
56
+ bls, bureau of labor statistics
57
+
58
+ djia, dow jones industrial average, dji, indu
59
+ spx, s&p 500, gspc, inx
60
+
61
+ # currency names and 3letter iso codes from wikipedia
62
+ ars, argentine peso
63
+ aud, australian dollar, australia dollar
64
+ bdt, bangladeshi taka
65
+ bgn, bulgarian lev
66
+ bhd, bahraini dinar
67
+ brl, brazilian real, brazil real
68
+ bsd, bahamian dollar
69
+ byr, belarusian ruble
70
+ bzd, belize dollar
71
+ cad, canadian dollar, canada dollar
72
+ chf, swiss franc, switzerland franc
73
+ clp, chilean peso, chili peso
74
+ cny, chinese yuan, china yuan, renminbi
75
+ cop, colombian peso
76
+ dkk, danish krone, denmark krone
77
+ dzd, algerian dinar
78
+ egp, egyptian pound, egypt pound
79
+ eur, euro
80
+ gbp, pound sterling, british pound, britain pound
81
+ hkd, hong kong dollar
82
+ idr, indonesian rupiah
83
+ ils, israeli shekel
84
+ inr, indian rupee, india rupee
85
+ iqd, iraqi dinar
86
+ irr, iranian rial
87
+ isk, icelandic krona
88
+ jod, jordanian dinar
89
+ jpy, japanese yen, japan yen
90
+ krw, korean won, korea won
91
+ mxn, mexican peso
92
+ myr, malaysian ringgit
93
+ nok, norway krone, norwegian krone
94
+ nzd, new zealand dollar
95
+ pkr, pakistani rupee
96
+ ron, romanian new
97
+ rub, russian rouble
98
+ sar, saudi riyal
99
+ sek, swedish krona
100
+ sgd, singapore dollar
101
+ thb, thai baht
102
+ vef, venezuelan bolivar fuerte
103
+ vnd, vietnamese dong
104
+ zar, south african rand
105
+
106
+
107
+ abkhazia, abkhaz, abkhazian
108
+ afghanistan, afghan
109
+ albania, albanian
110
+ algeria, algerian
111
+ andorra, andorran
112
+ angola, angolan
113
+ anguilla, anguillan
114
+ antigua, antiguan
115
+ barbuda, barbudan
116
+ argentina, argentine, argentinean, argentinian
117
+ armenia, armenian
118
+ aruba, aruban
119
+ australia, australian
120
+ austria, austrian
121
+ azerbaijan, azerbaijani, azeri
122
+ bahamas, bahamian
123
+ bahrain, bahraini
124
+ bangladesh, bangladeshi
125
+ barbados, barbadian, bajan
126
+ belarus, belarusian
127
+ belgium, belgian
128
+ belize, belizean
129
+ benin, beninese, beninois
130
+ bermuda, bermudian, bermudan
131
+ bhutan, bhutanese
132
+ bolivia, bolivian
133
+ bosnia, bosnian, bosniak
134
+ herzegovina, herzegovinian
135
+ botswana, motswana, batswana, botswanan
136
+ brazil, brazilian
137
+ brunei, bruneian
138
+ bulgaria, bulgarian
139
+ burma, myanmar, burmese
140
+ burundi, burundian
141
+ cambodia, cambodian
142
+ cameroon, cameroonian
143
+ canada, canadian
144
+ chad, chadian
145
+ chile, chilean
146
+ colombia, colombian
147
+ comoros, comorian
148
+ croatia, croatian
149
+ cuba, cuban
150
+ cyprus, cypriot
151
+ congo, congolese, zaire, zairean
152
+ denmark, danish
153
+ djibouti, djiboutian
154
+ dominica, dominican
155
+ ecuador, ecuadorian, ecuadorians
156
+ egypt, egyptian
157
+ eritrea, eritrean
158
+ estonia, estonian
159
+ ethiopia, ethiopian, abyssinia, abyssinian
160
+ fiji, fijian
161
+ finland, finnish, finn
162
+ france, french
163
+ gabon, gabonese
164
+ gambia, gambian
165
+ georgia, georgian
166
+ germany, german
167
+ ghana, ghanaian
168
+ greece, greek, grecian, hellenic
169
+ greenland, greenlandic
170
+ grenada, grenadian
171
+ guam, guamanian
172
+ guatemala, guatemalan
173
+ guineabissau, guinea, guinean
174
+ guyana, guyanese
175
+ haiti, haitian
176
+ honduras, honduran
177
+ hungary, hungarian, magyar
178
+ iceland, icelandic
179
+ india, indian
180
+ indonesia, indonesian
181
+ iran, iranian
182
+ iraq, iraqi
183
+ eire, ireland, irish
184
+ israel, israeli
185
+ italy, italian, italic
186
+ jamaica, jamaican
187
+ japan, japanese, nippon, nihon
188
+ jordan, jordanian
189
+ kazakhstan, kazakh, kazakhstani
190
+ kenya, kenyan
191
+ kosovo, kosovar, kosovan
192
+ kuwait, kuwaiti
193
+ kyrgyzstan, kyrgyzstani, kyrgyz, kirgiz, kirghiz
194
+ laos, laotian, lao
195
+ latvia, latvian
196
+ lebanon, lebanese
197
+ lesotho, basotho
198
+ liberia, liberian
199
+ libya, libyan
200
+ lithuania, lithuanian
201
+ luxembourg, luxembourgish, luxembourger
202
+ macau, macanese
203
+ madagascar, malagasy
204
+ malawi, malawian
205
+ malaysia, malaysian, malaya, malay
206
+ maldives, maldivian
207
+ mali, malian
208
+ malta, maltese
209
+ martinique, martiniquais, martinican
210
+ mauritania, mauritanian
211
+ mauritius, mauritian
212
+ mayotte, mahoran, mahorais
213
+ mexico, mexican
214
+ moldova, moldovan
215
+ monaco, monegasque, monacan
216
+ mongolia, mongolian, mongol
217
+ montenegro, montenegrin
218
+ montserrat, montserratian
219
+ morocco, moroccan
220
+ mozambique, mozambican
221
+ namibia, namibian
222
+ nauru, nauruan
223
+ nepal, nepali, nepalese
224
+ netherlands, dutch, holland
225
+ nicaragua, nicaraguan
226
+ niger, nigerien
227
+ nigeria, nigerian
228
+ niue, niuean
229
+ korea, korean
230
+ norway, norwegian
231
+ oman, omani
232
+ pakistan, pakistani
233
+ palau, palauan
234
+ panama, panamanian
235
+ paraguay, paraguayan
236
+ china, chinese
237
+ peru, peruvian
238
+ philippines, philippine, filipino, pinoy
239
+ poland, polish, pole
240
+ portugal, portuguese
241
+ qatar, qatari
242
+ macedonia, macedonian
243
+ romania, romanian
244
+ russia, russian
245
+ rwanda, rwandan
246
+ reunion, reunionese, reunionnais
247
+ saintpierre, saintpierrais
248
+ miquelon, miquelonnais
249
+ samoa, samoan
250
+ scotland, scots, scottish, scotch
251
+ senegal, senegalese
252
+ serbia, serbian, serb
253
+ seychelles, seychellois
254
+ singapore, singaporean
255
+ slovakia, slovak
256
+ slovenia, slovenian, slovene
257
+ somalia, somali, somalian
258
+ spain, spanish, spaniards
259
+ srilanka_syn, sri lanka, sri lankan, ceylon, ceylonese
260
+ sudan, sudanese
261
+ surinam, surinamese
262
+ swaziland, swazi
263
+ sweden, swedish
264
+ switzerland, swiss
265
+ syria, syrian
266
+ taiwan, taiwanese
267
+ tajikistan, tajikistani, tajik
268
+ tanzania, tanzanian
269
+ thailand, thai, siam, siamese
270
+ togo, togolese
271
+ tonga, tongan
272
+ trinidad, trinidadian
273
+ tobago, tobagonian
274
+ tunisia, tunisian
275
+ turkey, turkish
276
+ turkmenistan, turkmen
277
+ tuvalu, tuvaluan
278
+ uganda, ugandan
279
+ ukraine, ukrainian
280
+ uruguay, uruguayan
281
+ uzbekistan, uzbekistani, uzbek
282
+ vanuatu, nivanuatu, vanuatuan
283
+ venezuela, venezuelan
284
+ vietnam, vietnamese
285
+ wales, welsh
286
+ wallis, wallisian
287
+ futuna, futunan
288
+ yemen, yemeni
289
+ zambia, zambian
290
+ zimbabwe, zimbabwean, rhodesia, rhodesian
291
+ chechnya, chechnyan, chechen
292
+ czechoslovakia, czechoslovak, czech
293
+
294
+ el salvador, salvadoran
295
+ saudi arabia, saudi, saudi arabian
296
+ sierra leone, sierra leonean
297
+ south africa, south african
298
+ south korea, south korean
299
+ north korea, north korean
300
+ east timor, timorese
301
+ faroe islands, faroese
302
+ uae, united arab emirates, emirati, emirian
303
+ uk_syn, united kingdom, uk, british isles, great britain, england, british, english
304
+ usa, united states, united states of america, america, american, us
305
+ ussr, union of soviet socialist republics, soviet union
306
+
307
+ la, los angeles
308
+ ny, new york
309
+ sf, san francisco
310
+ annual, yearly
311
+ un, united nations
312
+ nyse, new york stock exchange
313
+ dept, department
314
+ fbi, federal bureau of investigation
315
+ us, u.s., u.s.a., usa, america, united states
316
+ btc, bitcoin
317
+ gov, government
318
+
@@ -0,0 +1,38 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://staging-search.quandl.com:9200//quandl_index/database/_search
6
+ body:
7
+ encoding: UTF-8
8
+ string: ! '{"explain":false,"fields":["_parent","code"],"query":{"filtered":{"query":{"bool":{"should":[{"multi_match":{"fields":["code","name^1.1","description","documentation^0.8"],"query":"stocks","type":"phrase","operator":"and","zero_terms_query":"all","slop":2}},{"has_child":{"type":"dataset","score_mode":"max","query":{"bool":{"should":[{"multi_match":{"fields":["name^1.1"],"query":"stocks","type":"phrase","slop":10}},{"multi_match":{"fields":["code","name^1.1"],"query":"stocks","type":"best_fields"}},{"prefix":{"code":"stocks"}}]}}}},{"prefix":{"code":"stocks"}}]}},"filter":{"bool":{"must":[{"term":{"premium":false}}]}}}},"from":0,"size":10,"rescore":{"window_size":10,"query":{"rescore_query":{"match":{"name":{"query":"stocks","type":"phrase","slop":10}}},"query_weight":0.7,"rescore_query_weight":1.2}}}'
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.1
12
+ Accept:
13
+ - ! '*/*'
14
+ Date:
15
+ - Fri, 22 May 2015 15:57:48 GMT
16
+ Content-Type:
17
+ - application/x-www-form-urlencoded
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: !binary |-
22
+ T0s=
23
+ headers:
24
+ !binary "Q29udGVudC1UeXBl":
25
+ - !binary |-
26
+ YXBwbGljYXRpb24vanNvbjsgY2hhcnNldD1VVEYtOA==
27
+ !binary "Q29udGVudC1MZW5ndGg=":
28
+ - !binary |-
29
+ MTIwMw==
30
+ !binary "Q29ubmVjdGlvbg==":
31
+ - !binary |-
32
+ a2VlcC1hbGl2ZQ==
33
+ body:
34
+ encoding: US-ASCII
35
+ string: ! '{"took":752,"timed_out":false,"_shards":{"total":1,"successful":1,"failed":0},"hits":{"total":130,"max_score":2.7896662,"hits":[{"_index":"quandl_main_v6","_type":"database","_id":"33","_score":3.7459924,"fields":{"code":["NSE"]}},{"_index":"quandl_main_v6","_type":"database","_id":"460","_score":3.4402916,"fields":{"code":["LUXSE"]}},{"_index":"quandl_main_v6","_type":"database","_id":"442","_score":3.391498,"fields":{"code":["ZAGREBSE"]}},{"_index":"quandl_main_v6","_type":"database","_id":"462","_score":3.381187,"fields":{"code":["BUCHARESTSE"]}},{"_index":"quandl_main_v6","_type":"database","_id":"5628","_score":3.2165365,"fields":{"code":["EURONEXT"]}},{"_index":"quandl_main_v6","_type":"database","_id":"450","_score":3.0062313,"fields":{"code":["PHILSE"]}},{"_index":"quandl_main_v6","_type":"database","_id":"663","_score":2.9658709,"fields":{"code":["SI"]}},{"_index":"quandl_main_v6","_type":"database","_id":"1383","_score":1.5982721,"fields":{"code":["SIX"]}},{"_index":"quandl_main_v6","_type":"database","_id":"464","_score":1.5879608,"fields":{"code":["NIKKEI"]}},{"_index":"quandl_main_v6","_type":"database","_id":"8401","_score":1.2901201,"fields":{"code":["CRYPTOCHART"]}}]}}'
36
+ http_version:
37
+ recorded_at: Fri, 22 May 2015 15:57:50 GMT
38
+ recorded_with: VCR 2.9.3