PoseBiz/stretcher — pull request #8 by rulesio (2013-03-06 06:42:54+00:00)
Title: indexing with automatic ID generation

By the way, I found that the specs do not pass in master, in the base repo.

Failures:

1) Stretcher::Index should search without error
Failure/Error: res.results.first.text.should == match_text
expected: "Foo"
got: nil (using ==)
# ./spec/lib/stretcher_index_spec.rb:71:in `block (2 levels) in '

2) Stretcher::Index should be existentially aware
Failure/Error: type.get_mapping.should == mapping
expected: {"bar"=>{"properties"=>{"message"=>{"type"=>"string"}}}}
got: # properties=# meta=#>>> (using ==)
Diff:
@@ -1,2 +1,2 @@
-"bar" => {"properties"=>{"message"=>{"type"=>"string"}}}
+"bar" => {"_source"=>{"includes"=>["meta.*"]}, "properties"=>{"message"=>{"type"=>"string"}, "meta"=>{"type"=>"object", "include_in_all"=>false}}}

# ./spec/lib/stretcher_index_type_spec.rb:14:in `block (2 levels) in '

3) Stretcher::Index searching should search and find the right doc
Failure/Error: res.results.first.message.should == @doc[:message]
expected: "hello"
got: nil (using ==)
# ./spec/lib/stretcher_index_type_spec.rb:27:in `block (3 levels) in '

4) Stretcher::Index searching should build results when _source is not included in loaded fields
Failure/Error: res = type.search({}, {query: {match_all: {}}, fields: ['message']})
NoMethodError:
undefined method `merge' for nil:NilClass
# ./lib/stretcher/search_results.rb:22:in `block in initialize'
# ./lib/stretcher/search_results.rb:21:in `collect'
# ./lib/stretcher/search_results.rb:21:in `initialize'
# ./lib/stretcher/es_component.rb:24:in `new'
# ./lib/stretcher/es_component.rb:24:in `do_search'
# ./lib/stretcher/index_type.rb:75:in `search'
# ./spec/lib/stretcher_index_type_spec.rb:31:in `block (3 levels) in '

Finished in 0.42109 seconds
28 examples, 4 failures

Failed examples:

rspec ./spec/lib/stretcher_index_spec.rb:66 # Stretcher::Index should search without error
rspec ./spec/lib/stretcher_index_type_spec.rb:8 # Stretcher::Index should be existentially aware
rspec ./spec/lib/stretcher_index_type_spec.rb:22 # Stretcher::Index searching should search and find the right doc
rspec ./spec/lib/stretcher_index_type_spec.rb:30 # Stretcher::Index searching should build results when _source is not included in loaded fields