Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

45 lines (31 sloc) 1.341 kB
require 'test_helper'
module Slingshot
class IndexMappingIntegrationTest < Test::Unit::TestCase
include Test::Integration
context "Default mapping" do
teardown { Slingshot.index('mapped-index').delete }
should "create and return the default mapping" do
index = Slingshot.index 'mapped-index' do
create
store :article, :title => 'One'
refresh
end
sleep 1
assert_equal 'string', index.mapping['article']['properties']['title']['type'], index.mapping.inspect
assert_nil index.mapping['article']['properties']['title']['boost'], index.mapping.inspect
end
end
context "Creating index with mapping" do
teardown { Slingshot.index('mapped-index').delete; sleep 1 }
should "create the specified mapping" do
index = Slingshot.index 'mapped-index' do
create :mappings => { :article => { :properties => { :title => { :type => 'string', :boost => 2.0, :store => 'yes' } } } }
end
sleep 1
# p index.mapping
assert_equal 2.0, index.mapping['article']['properties']['title']['boost'], index.mapping.inspect
assert_equal 'yes', index.mapping['article']['properties']['title']['store'], index.mapping.inspect
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.