tire 0.5.8 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +25 -3
- data/lib/tire.rb +1 -0
- data/lib/tire/dsl.rb +16 -7
- data/lib/tire/http/client.rb +4 -0
- data/lib/tire/http/clients/curb.rb +4 -0
- data/lib/tire/http/clients/faraday.rb +7 -3
- data/lib/tire/index.rb +23 -10
- data/lib/tire/model/import.rb +13 -4
- data/lib/tire/model/indexing.rb +2 -1
- data/lib/tire/results/collection.rb +10 -5
- data/lib/tire/results/item.rb +3 -0
- data/lib/tire/search/facet.rb +5 -5
- data/lib/tire/search/queries/custom_filters_score.rb +128 -0
- data/lib/tire/search/query.rb +8 -10
- data/lib/tire/tasks.rb +1 -11
- data/lib/tire/version.rb +13 -7
- data/test/integration/bulk_test.rb +13 -0
- data/test/integration/custom_filters_score_queries_test.rb +105 -0
- data/test/integration/dsl_search_test.rb +32 -0
- data/test/integration/facets_test.rb +47 -0
- data/test/integration/results_test.rb +31 -1
- data/test/unit/http_client_test.rb +8 -0
- data/test/unit/index_test.rb +37 -9
- data/test/unit/model_import_test.rb +17 -0
- data/test/unit/model_initialization_test.rb +43 -4
- data/test/unit/results_collection_test.rb +62 -0
- data/test/unit/results_item_test.rb +39 -1
- data/test/unit/search_facet_test.rb +15 -0
- data/test/unit/search_query_test.rb +129 -14
- data/test/unit/tire_test.rb +13 -0
- data/tire.gemspec +1 -0
- metadata +30 -10
- data/test/integration/text_query_test.rb +0 -39
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tire
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-06-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -203,6 +203,22 @@ dependencies:
|
|
203
203
|
- - ! '>='
|
204
204
|
- !ruby/object:Gem::Version
|
205
205
|
version: '3.0'
|
206
|
+
- !ruby/object:Gem::Dependency
|
207
|
+
name: active_model_serializers
|
208
|
+
requirement: !ruby/object:Gem::Requirement
|
209
|
+
none: false
|
210
|
+
requirements:
|
211
|
+
- - ! '>='
|
212
|
+
- !ruby/object:Gem::Version
|
213
|
+
version: '0'
|
214
|
+
type: :development
|
215
|
+
prerelease: false
|
216
|
+
version_requirements: !ruby/object:Gem::Requirement
|
217
|
+
none: false
|
218
|
+
requirements:
|
219
|
+
- - ! '>='
|
220
|
+
- !ruby/object:Gem::Version
|
221
|
+
version: '0'
|
206
222
|
- !ruby/object:Gem::Dependency
|
207
223
|
name: mongoid
|
208
224
|
requirement: !ruby/object:Gem::Requirement
|
@@ -404,6 +420,7 @@ files:
|
|
404
420
|
- lib/tire/search/facet.rb
|
405
421
|
- lib/tire/search/filter.rb
|
406
422
|
- lib/tire/search/highlight.rb
|
423
|
+
- lib/tire/search/queries/custom_filters_score.rb
|
407
424
|
- lib/tire/search/queries/match.rb
|
408
425
|
- lib/tire/search/query.rb
|
409
426
|
- lib/tire/search/scan.rb
|
@@ -425,6 +442,7 @@ files:
|
|
425
442
|
- test/integration/bulk_test.rb
|
426
443
|
- test/integration/constant_score_queries_test.rb
|
427
444
|
- test/integration/count_test.rb
|
445
|
+
- test/integration/custom_filters_score_queries_test.rb
|
428
446
|
- test/integration/custom_score_queries_test.rb
|
429
447
|
- test/integration/dis_max_queries_test.rb
|
430
448
|
- test/integration/dsl_search_test.rb
|
@@ -453,7 +471,6 @@ files:
|
|
453
471
|
- test/integration/scan_test.rb
|
454
472
|
- test/integration/script_fields_test.rb
|
455
473
|
- test/integration/sort_test.rb
|
456
|
-
- test/integration/text_query_test.rb
|
457
474
|
- test/models/active_model_article.rb
|
458
475
|
- test/models/active_model_article_with_callbacks.rb
|
459
476
|
- test/models/active_model_article_with_custom_document_type.rb
|
@@ -503,12 +520,15 @@ homepage: http://github.com/karmi/tire
|
|
503
520
|
licenses: []
|
504
521
|
post_install_message: ! "================================================================================\n\n
|
505
522
|
\ Please check the documentation at <http://karmi.github.com/tire/>.\n\n--------------------------------------------------------------------------------\n\n
|
506
|
-
\ IMPORTANT CHANGES LATELY:\n\n * Fixed
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
523
|
+
\ IMPORTANT CHANGES LATELY:\n\n * Fixed incorrect inflection in the Rake import
|
524
|
+
tasks\n * Added support for `geo_distance` facets\n * Added support for the `custom_filters_score`
|
525
|
+
query\n * Added a custom strategy option to <Model.import>\n * Allow the `:wrapper`
|
526
|
+
option to be passed to Tire.search consistently\n * Improved the Mongoid importing
|
527
|
+
strategy\n * Merge returned `fields` with `_source` if both are returned\n * Removed
|
528
|
+
the deprecated `text` query\n * [FIX] Rescue HTTP client specific connection errors
|
529
|
+
in MyModel#create_elasticsearch_index\n * Added support for passing `version` in
|
530
|
+
Tire::Index#store\n * Added support for `_version_type` in Tire::Index#bulk\n *
|
531
|
+
Added ActiveModel::Serializers compatibility\n\n See the full changelog at <http://github.com/karmi/tire/commits/v0.6.0>.\n\n--------------------------------------------------------------------------------\n"
|
512
532
|
rdoc_options:
|
513
533
|
- --charset=UTF-8
|
514
534
|
require_paths:
|
@@ -545,6 +565,7 @@ test_files:
|
|
545
565
|
- test/integration/bulk_test.rb
|
546
566
|
- test/integration/constant_score_queries_test.rb
|
547
567
|
- test/integration/count_test.rb
|
568
|
+
- test/integration/custom_filters_score_queries_test.rb
|
548
569
|
- test/integration/custom_score_queries_test.rb
|
549
570
|
- test/integration/dis_max_queries_test.rb
|
550
571
|
- test/integration/dsl_search_test.rb
|
@@ -573,7 +594,6 @@ test_files:
|
|
573
594
|
- test/integration/scan_test.rb
|
574
595
|
- test/integration/script_fields_test.rb
|
575
596
|
- test/integration/sort_test.rb
|
576
|
-
- test/integration/text_query_test.rb
|
577
597
|
- test/models/active_model_article.rb
|
578
598
|
- test/models/active_model_article_with_callbacks.rb
|
579
599
|
- test/models/active_model_article_with_custom_document_type.rb
|
@@ -1,39 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
module Tire
|
4
|
-
|
5
|
-
class QueryStringIntegrationTest < Test::Unit::TestCase
|
6
|
-
include Test::Integration
|
7
|
-
|
8
|
-
context "Text query" do
|
9
|
-
setup do
|
10
|
-
Tire.index('articles-test') do
|
11
|
-
store :type => 'article', :title => '+1 !!!'
|
12
|
-
store :type => 'article', :title => 'Furry Kitten'
|
13
|
-
refresh
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
should "find article by title" do
|
18
|
-
results = Tire.search('articles-test') do
|
19
|
-
query { text :title, '+1' }
|
20
|
-
end.results
|
21
|
-
|
22
|
-
assert_equal 1, results.count
|
23
|
-
assert_equal "+1 !!!", results.first[:title]
|
24
|
-
end
|
25
|
-
|
26
|
-
should "allow to pass options (fuzziness)" do
|
27
|
-
results = Tire.search('articles-test') do
|
28
|
-
query { text :title, 'fuzzy mitten', :fuzziness => 0.5, :operator => 'and' }
|
29
|
-
end.results
|
30
|
-
|
31
|
-
assert_equal 1, results.count
|
32
|
-
assert_equal "Furry Kitten", results.first[:title]
|
33
|
-
end
|
34
|
-
|
35
|
-
end
|
36
|
-
|
37
|
-
end
|
38
|
-
|
39
|
-
end
|