Skip to content
Browse files

Fixed field_infos. Cleaned up attribute getting.

  • Loading branch information...
1 parent 5feb4fe commit ded576a0dd33db4510faf068d71b29821027401e @bernerdschaefer bernerdschaefer committed
View
5 adapters/dm-ferret-adapter/lib/ferret_adapter.rb
@@ -22,10 +22,7 @@ def initialize(name, uri_or_options)
def create(resources)
resources.each do |resource|
- attributes = resource.attributes
- attributes.delete_if do |name, value|
- !resource.class.properties(self.name).has_property?(name)
- end
+ attributes = repository(@name) { resource.class.new(resource.attributes).attributes }
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 => :no, :term_vector => :no, :store => :yes)
+ field_infos.add_field(:_type, :index => :untokenized, :term_vector => :no, :store => :yes)
@index = ::Ferret::Index::Index.new( @options.merge(:field_infos => field_infos) )
else
@index = ::Ferret::Index::Index.new( @options )

0 comments on commit ded576a

Please sign in to comment.
Something went wrong with that request. Please try again.