qiita-elasticsearch 0.12.0 → 0.12.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2739d71614bc3e23cd2e87ea69d6bfab77e184ba
4
- data.tar.gz: 222c760499b279b46434421269ae1921a95cf624
3
+ metadata.gz: 7187590b9b23a7438390a285bd06fbed399a44f1
4
+ data.tar.gz: 82a7baa53b312991cbba0c4a0c63e87ed1b86cff
5
5
  SHA512:
6
- metadata.gz: 1a87eb4c0a48a3bd39bf738c1a488a0bdd477b59101d82be4402b3a8b20574985d5e30ca34cc7e7726987ec094bbcb0a5f6e66fb696b04bedf7fdbb7f6f70be8
7
- data.tar.gz: 890aad3689bdd9ab9d233c5f86b683e81e182e6db1391cbe1f8913c05c7076d1259f718ad82fdfa993b7edeb216281f70f8e23f383e6458c3cb9bd901deab8ec
6
+ metadata.gz: ff9f8bfc91c03839967e115ff84905f06f2b678c3b0fd479f0bd4ceaa18c4ea8fa53a4f680651731d974c1b6f58ae1cac922659ae3787987bba7bfad0b09368d
7
+ data.tar.gz: af7d9f318eb599afa6f6e9b65e42266ea792253c1559c7fd3f255cd982779292923183980752911fcc27817dcd47798884f523d0143c776d111c114c0a46aa42
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.12.1
2
+ - Add Query#sort_term method
3
+
1
4
  ## 0.12.0
2
5
  - Build AND search query for term tokens (e.g. "foo bar" means "foo AND bar")
3
6
 
@@ -57,7 +57,7 @@ module Qiita
57
57
 
58
58
  # @return [Array] sort property for request body for Elasticsearch
59
59
  def sort
60
- case @tokens.select(&:sort?).last.try(:term)
60
+ case sort_term
61
61
  when "created-asc"
62
62
  [{ "created_at" => "asc" }, "_score"]
63
63
  when "lgtms-asc"
@@ -81,6 +81,10 @@ module Qiita
81
81
  end
82
82
  end
83
83
 
84
+ def sort_term
85
+ @tokens.select(&:sort?).last.try(:term)
86
+ end
87
+
84
88
  # @return [Hash] request body for Elasticsearch
85
89
  def to_hash
86
90
  {
@@ -1,5 +1,5 @@
1
1
  module Qiita
2
2
  module Elasticsearch
3
- VERSION = "0.12.0"
3
+ VERSION = "0.12.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qiita-elasticsearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura