Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: a016cdefaa
Fetching contributors…

Cannot retrieve contributors at this time

39 lines (30 sloc) 0.836 kB
# coding: utf-8
require 'test_helper'
class Mappings < Test::Unit::TestCase
load_schema
class User < ActiveRecord::Base
elastic_index(
:mapping => {
:properties => {
:name => {:type => "string", :index => "not_analyzed"}
}
}
)
end
def test_not_analyzed_property
User.delete_all
User.delete_index
Escargot::LocalIndexing.create_index_for_model(User)
User.create(:name => 'Pedrín el Joven')
User.create(:name => 'Pedro el Viejo')
User.create(:name => 'Roberto el Delgado')
User.create(:name => 'Jamie la Máquina Voladora')
User.refresh_index
assert_equal User.search_count('name=pedro'), 0
assert_equal User.search_count('name="Pedro el Viejo"'), 1
end
def teardown
User.delete_all
User.delete_index
end
end
Jump to Line
Something went wrong with that request. Please try again.