Permalink
Browse files

Fixed bug in attribute paring, removed _type from index.

  • Loading branch information...
bernerdschaefer committed Sep 25, 2008
1 parent 96d8d33 commit 4857fdcf83598ceef41acd8c0ffa1f1be6781bd9
@@ -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
@@ -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 )

0 comments on commit 4857fdc

Please sign in to comment.