mm_es_search 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -128,7 +128,15 @@ module MmEsSearch
128
128
  end
129
129
 
130
130
  def best_time_unit
131
- diff = Time.diff(stats.min, stats.max)
131
+ if rows.present?
132
+ all_times = rows.map { |r| [r.from, r.to] }.flatten.compact
133
+ min = all_times.min
134
+ max = all_times.max
135
+ else
136
+ min = stats.min
137
+ max = stats.max
138
+ end
139
+ diff = Time.diff(min, max)
132
140
  if diff[:year].abs > 0 then :year
133
141
  elsif diff[:month].abs > 0 then :month
134
142
  elsif diff[:day].abs > 0 then :day
@@ -307,7 +315,8 @@ module MmEsSearch
307
315
  end
308
316
 
309
317
  values.map!(&final_casting)
310
- if scale
318
+ puts "SCALE SCALE SCALE is #{scale}"
319
+ if scale and not scale.zero?
311
320
  values.map! { |v| v/scale }
312
321
  end
313
322
 
@@ -73,6 +73,7 @@ module MmEsSearch
73
73
  self.facet_status = :pending
74
74
  elsif all_facets_finished?
75
75
  self.facet_status = :complete
76
+ puts "MARKING FACETS AS COMPLETE AFTER FIRST RUN"
76
77
  end
77
78
 
78
79
  # #NOTE HACK while investigating search
@@ -333,6 +334,10 @@ module MmEsSearch
333
334
 
334
335
  self.last_run_at = Time.now.utc
335
336
 
337
+ if self.class::MIN_FACET_COVERAGE_COUNT and result_total < self.class::MIN_FACET_COVERAGE_COUNT
338
+ @auto_explore_needed = false
339
+ end
340
+
336
341
  end
337
342
 
338
343
  def route_facet_query_results
@@ -356,6 +361,10 @@ module MmEsSearch
356
361
 
357
362
  end
358
363
 
364
+ def prune
365
+ puts "PRUNE WAS CALLED IN A #{self.class.name}"
366
+ end
367
+
359
368
  def have_pending_facets?
360
369
  facets.any? { |f| f.current_state != :ready_for_display } || (@auto_explore_needed and type_facet_positively_set?)
361
370
  end
@@ -6,7 +6,7 @@ module MmEsSearch
6
6
 
7
7
  included do
8
8
 
9
- DEFAULT_NUM_RESULTS ||= 10
9
+ DEFAULT_NUM_RESULTS ||= 25
10
10
 
11
11
  # redefinition to include default
12
12
  many :rows, :class_name => 'MmEsSearch::Api::Facet::TermsFacetRow'
@@ -1,3 +1,3 @@
1
1
  module MmEsSearch
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,12 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mm_es_search
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 0
8
- - 1
9
- version: 0.0.1
4
+ prerelease:
5
+ version: 0.0.2
10
6
  platform: ruby
11
7
  authors:
12
8
  - Jonathan Chambers
@@ -14,8 +10,7 @@ autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
12
 
17
- date: 2012-12-21 00:00:00 +00:00
18
- default_executable:
13
+ date: 2013-02-15 00:00:00 Z
19
14
  dependencies: []
20
15
 
21
16
  description: Provides modules that can form the basis of a mongomapper class implementing a search model.
@@ -96,7 +91,6 @@ files:
96
91
  - lib/mm_es_search/utils/search_logger.rb
97
92
  - lib/mm_es_search/version.rb
98
93
  - mm_es_search.gemspec
99
- has_rdoc: true
100
94
  homepage: https://github.com/jmchambers/mm_es_search
101
95
  licenses: []
102
96
 
@@ -110,21 +104,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
110
104
  requirements:
111
105
  - - ">="
112
106
  - !ruby/object:Gem::Version
113
- segments:
114
- - 0
115
107
  version: "0"
116
108
  required_rubygems_version: !ruby/object:Gem::Requirement
117
109
  none: false
118
110
  requirements:
119
111
  - - ">="
120
112
  - !ruby/object:Gem::Version
121
- segments:
122
- - 0
123
113
  version: "0"
124
114
  requirements: []
125
115
 
126
116
  rubyforge_project: mm_es_search
127
- rubygems_version: 1.3.7
117
+ rubygems_version: 1.8.17
128
118
  signing_key:
129
119
  specification_version: 3
130
120
  summary: Tools to build a mongomapper model that stores and executes complex elasticsearch queries.