Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed bug in attribute paring, removed _type from index.

  • Loading branch information...
commit 4857fdcf83598ceef41acd8c0ffa1f1be6781bd9 1 parent 96d8d33
@bernerdschaefer bernerdschaefer authored
View
4 adapters/dm-ferret-adapter/lib/ferret_adapter.rb
@@ -23,7 +23,9 @@ def initialize(name, uri_or_options)
def create(resources)
resources.each do |resource|
attributes = resource.attributes
- attributes.delete_if { |name, value| !resource.class.properties(self.name).has_property?(name) }
+ attributes.delete_if do |name, value|
+ !resource.class.properties(self.name).has_property?(name)
+ end
attributes.merge!(:_type => resource.class.name)
@index.add attributes
end
View
2  adapters/dm-ferret-adapter/lib/ferret_adapter/local_index.rb
@@ -32,7 +32,7 @@ def create_or_initialize_index
unless File.exists?(@uri.path + "segments")
field_infos = ::Ferret::Index::FieldInfos.new(:store => :no)
field_infos.add_field(:id, :index => :untokenized, :term_vector => :no, :store => :yes)
- field_infos.add_field(:_type, :index => :untokenized, :store => :yes)
+ field_infos.add_field(:_type, :index => :no, :term_vector => :no, :store => :yes)
@index = ::Ferret::Index::Index.new( @options.merge(:field_infos => field_infos) )
else
@index = ::Ferret::Index::Index.new( @options )
Please sign in to comment.
Something went wrong with that request. Please try again.