neo4j 1.0.0.beta.16 → 1.0.0.beta.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CONTRIBUTORS CHANGED
@@ -2,6 +2,7 @@ Maintainer:
2
2
  Andreas Ronge <andreas dot ronge at gmail dot com>
3
3
 
4
4
  Contributors:
5
+ * Ben Jackson
5
6
  * Martin Kleppmann
6
7
  * Peter Neubauer
7
8
  * Jan-Felix Wittmann
data/Gemfile CHANGED
@@ -10,3 +10,7 @@ group 'test' do
10
10
  gem "rspec", ">= 2.0.0"
11
11
  gem "rspec-rails-matchers", ">= 0.2.1"
12
12
  end
13
+
14
+ gem 'ruby-debug-base19' if RUBY_VERSION.include? "1.9"
15
+ gem 'ruby-debug-base' if RUBY_VERSION.include? "1.8"
16
+ gem "ruby-debug-ide"
data/README.rdoc CHANGED
@@ -76,15 +76,15 @@ Example of using Neo4j with Rails 3 (ActiveModel)
76
76
 
77
77
  email_regex = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
78
78
 
79
- validates :email, :presence => true,:format => { :with => email_regex }
80
- validates :email, :uniqueness => true, :unless => :pending_account?
81
- accepts_nested_attributes_for :avatar, :allow_destroy => true
82
-
83
79
  property :email
84
80
  index :email
85
81
 
86
82
  has_one(:avatar).to(Avator)
87
83
 
84
+ validates :email, :presence => true,:format => { :with => email_regex }
85
+ validates :email, :uniqueness => true, :unless => :pending_account?
86
+ accepts_nested_attributes_for :avatar, :allow_destroy => true
87
+
88
88
  ...
89
89
  end
90
90
 
data/lib/neo4j.rb CHANGED
@@ -5,10 +5,11 @@ require 'forwardable'
5
5
  require 'time'
6
6
  require 'date'
7
7
 
8
- require 'neo4j/jars/neo4j-kernel-1.1.1.jar'
8
+ require 'neo4j/jars/neo4j-index-1.2-1.2.M02.jar'
9
+ require 'neo4j/jars/neo4j-kernel-1.2-1.2.M02.jar'
10
+ require 'neo4j/jars/neo4j-lucene-index-0.2-1.2.M02.jar'
9
11
  require 'neo4j/jars/geronimo-jta_1.1_spec-1.1.1.jar'
10
12
  require 'neo4j/jars/lucene-core-3.0.1.jar'
11
- require 'neo4j/jars/neo4j-lucene-index-0.1-20101002.153213-102.jar'
12
13
  require 'neo4j/to_java'
13
14
  require 'neo4j/version'
14
15
  require 'neo4j/equal'
data/lib/neo4j/config.rb CHANGED
@@ -17,8 +17,8 @@ module Neo4j
17
17
  @defaults ||= {
18
18
  :storage_path => 'tmp/neo4j',
19
19
  :lucene => {
20
- :fulltext => org.neo4j.index.impl.lucene.LuceneIndexProvider::FULLTEXT_CONFIG,
21
- :exact => org.neo4j.index.impl.lucene.LuceneIndexProvider::EXACT_CONFIG}
20
+ :fulltext => {"provider" => "lucene", "type" => "fulltext" },
21
+ :exact => {"provider" => "lucene", "type" => "exact" }}
22
22
  }
23
23
  end
24
24
 
@@ -9,7 +9,7 @@ module Neo4j
9
9
 
10
10
  def start
11
11
  @graph = org.neo4j.kernel.EmbeddedGraphDatabase.new(Config[:storage_path])
12
- @lucene = org.neo4j.index.impl.lucene.LuceneIndexProvider.new(@graph)
12
+ @lucene = @graph.index #org.neo4j.index.impl.lucene.LuceneIndexProvider.new
13
13
  @graph.register_transaction_event_handler(@event_handler)
14
14
  @running = true
15
15
  @event_handler.neo4j_started(self)
@@ -18,12 +18,6 @@ module Neo4j
18
18
 
19
19
  def shutdown
20
20
  if @running
21
- # since we might keep a reference to indexes we must clear them so
22
- # that we can start neo4j with a fresh new lucene indexes
23
- Neo4j::Transaction.run do
24
- Neo4j::Index::IndexerRegistry.clear_all_indexes
25
- end
26
-
27
21
  @graph.unregister_transaction_event_handler(@event_handler)
28
22
  @event_handler.neo4j_shutdown(self)
29
23
  @graph.shutdown
@@ -18,7 +18,7 @@ module Neo4j
18
18
  # :singleton-method: find
19
19
 
20
20
 
21
- def_delegators :@_indexer, :index, :find, :index?, :index_type?, :clear_index_type, :rm_index_type, :add_index, :rm_index, :index_type_for, :index_name
21
+ def_delegators :@_indexer, :index, :find, :index?, :index_type?, :delete_index_type, :rm_field_type, :add_index, :rm_index, :index_type_for, :index_name
22
22
 
23
23
 
24
24
  # Sets which indexer should be used for the given node class.
@@ -3,14 +3,14 @@ module Neo4j
3
3
  class IndexerRegistry #:nodoc:
4
4
  class << self
5
5
 
6
- def clear_all_indexes
7
- @@indexers.values.each {|i| i.clear_index_type}
6
+ def delete_all_indexes
7
+ @@indexers.values.each {|i| i.delete_index_type}
8
8
  end
9
9
 
10
10
  def create_for(this_clazz, using_other_clazz, type)
11
- @@indexers ||= {}
12
- index = Indexer.new(this_clazz, type)
13
- index.inherit_fields_from(@@indexers[using_other_clazz.to_s])
11
+ @@indexers ||= {}
12
+ index = Indexer.new(this_clazz, type)
13
+ index.inherit_fields_from(@@indexers[using_other_clazz.to_s])
14
14
  @@indexers[this_clazz.to_s] = index
15
15
  end
16
16
 
@@ -156,12 +156,14 @@ module Neo4j
156
156
  end
157
157
 
158
158
  # clears the index, if no type is provided clear all types of indexes
159
- def clear_index_type(type=nil)
159
+ def delete_index_type(type=nil)
160
160
  if type
161
161
  #raise "can't clear index of type '#{type}' since it does not exist ([#{@field_types.values.join(',')}] exists)" unless index_type?(type)
162
- @indexes[type] && @indexes[type].clear
162
+ @indexes[type] && @indexes[type].delete
163
+ @indexes[type] = nil
163
164
  else
164
- @indexes.each_value { |index| index.clear }
165
+ @indexes.each_value { |index| index.delete }
166
+ @indexes.clear
165
167
  end
166
168
  end
167
169
 
@@ -171,7 +173,7 @@ module Neo4j
171
173
  @indexes.clear
172
174
  end
173
175
 
174
- def rm_index_type(type=nil)
176
+ def rm_field_type(type=nil)
175
177
  if type
176
178
  @field_types.delete_if { |k, v| v == type }
177
179
  else
@@ -198,9 +200,9 @@ module Neo4j
198
200
  db=Neo4j.started_db
199
201
  index_config = lucene_config(type)
200
202
  if @type == :node
201
- db.lucene.node_index("#{@indexer_for}-#{type}", index_config)
203
+ db.lucene.for_nodes("#{@indexer_for}-#{type}", index_config)
202
204
  else
203
- db.lucene.relationship_index("#{@indexer_for}-#{type}", index_config)
205
+ db.lucene.for_relationships("#{@indexer_for}-#{type}", index_config)
204
206
  end
205
207
  end
206
208
 
data/lib/neo4j/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Neo4j
2
- VERSION = "1.0.0.beta.16"
2
+ VERSION = "1.0.0.beta.17"
3
3
  end
metadata CHANGED
@@ -7,8 +7,8 @@ version: !ruby/object:Gem::Version
7
7
  - 0
8
8
  - 0
9
9
  - beta
10
- - 16
11
- version: 1.0.0.beta.16
10
+ - 17
11
+ version: 1.0.0.beta.17
12
12
  platform: ruby
13
13
  authors:
14
14
  - Andreas Ronge
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-10-28 00:00:00 +02:00
19
+ date: 2010-11-02 00:00:00 +01:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -86,8 +86,9 @@ files:
86
86
  - lib/neo4j/rails/validations/uniqueness.rb
87
87
  - lib/neo4j/jars/lucene-core-3.0.1.jar
88
88
  - lib/neo4j/jars/geronimo-jta_1.1_spec-1.1.1.jar
89
- - lib/neo4j/jars/neo4j-kernel-1.1.1.jar
90
- - lib/neo4j/jars/neo4j-lucene-index-0.1-20101002.153213-102.jar
89
+ - lib/neo4j/jars/neo4j-lucene-index-0.2-1.2.M02.jar
90
+ - lib/neo4j/jars/neo4j-kernel-1.2-1.2.M02.jar
91
+ - lib/neo4j/jars/neo4j-index-1.2-1.2.M02.jar
91
92
  - lib/neo4j/mapping/decl_relationship_dsl.rb
92
93
  - lib/neo4j/mapping/node_mixin.rb
93
94
  - lib/neo4j/mapping/has_n.rb
Binary file