Skip to content

Commit

Permalink
release 0.0.5, added CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasronge committed Nov 17, 2008
1 parent 67461e9 commit 0e10242
Show file tree
Hide file tree
Showing 11 changed files with 97 additions and 48 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
== 0.0.5 / 2009-11-17
* Supports keeping lucene index in memory instead of on disk
* Added support for lucene full text search
* Fixed so neo4j runs on JRuby 1.1.5
* Implemented support for reindex all instances of a node class. This is needed if the lucene index is kept in memory or if the index is changed.
* Added ReferenceNode. All nodes now have a relationship from this reference node.
* Lots of refactoring
* Added the IMDB example. It shows how to create a neo database, lucene queries and node traversals.

== 0.0.4 / 2009-10-23
* First release to rubyforge
22 changes: 20 additions & 2 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ To install from the source:
* Press the download button at http://github.com/andreasronge/neo4j/tree/master
* From command line type: ''rake gem:install''

JRuby version 1.1.4 does not work with Neo4j.rb because of a bug (JRUBY-2959).
This bug will be solved in JRuby 1.1.5. JRuby 1.1.3 does work.
JRuby version 1.1.4 does not work with Neo4j.rb because of a JRuby bug.
This bug is fixed in JRuby 1.1.5.

== Two Minute Tutorial
require "rubygems"
Expand Down Expand Up @@ -708,6 +708,24 @@ The query above can also be written in a lucene query DSL:

For more information see the lucene module above.

=== Indexing and Property Types

In order to use range querie on numbers the property types must be converted.
This is done by using the :type optional parameter:

class Person
include Neo4j::NodeMixin
properties :name, :age
index :age, :type => Fixnum
end

By using :type => Fixnum the age will be padded with '0's (lucene only support string comparsion).

Example, if the :type => Fixnum was not specified then

p = Person.new {|n| n.age = 100 }
Person.find(:age => 0..8) # => [p]

=== Indexing and Quering Relationships

The Neo4j::NodeMixin#index method can be used to index relationships to other classes.
Expand Down
5 changes: 2 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ Spec::Rake::SpecTask.new do |t|
t.libs << "lib"
# t.rcov = true # have not got RCov working with JRuby yet - but it should ...
t.spec_files = FileList['test/**/*_spec.rb']
# t.warning = true
t.spec_opts = ['--format specdoc', '--color']
# t.spec_opts = ['--format html:../doc/output/report.html'] #,'--backtrace']
end
Expand All @@ -59,7 +58,7 @@ end
CLEAN.include ["*.gem", "pkg", "rdoc", "coverage", "tools/*.png", 'var']

# The file list used to package tarballs, gems, and for generating the xmpp4r.gemspec.
PKG_FILES = %w( LICENSE README.rdoc TODO Rakefile neo4j.gemspec ) + Dir["{lib,test,examples}/**/*"]
PKG_FILES = %w( LICENSE CHANGELOG README.rdoc TODO Rakefile neo4j.gemspec ) + Dir["{lib,test,examples}/**/*"]

spec = Gem::Specification.new do |s|
s.name = GEM_NAME
Expand All @@ -77,7 +76,7 @@ spec = Gem::Specification.new do |s|
#s.homepage = 'http://neo4j.rubyforge.org'
# rdoc
s.has_rdoc = true
s.extra_rdoc_files = %w( README.rdoc )
s.extra_rdoc_files = %w( README.rdoc )
s.rdoc_options = ["--quiet", "--title", "neo4j and lucene documentation", "--opname", "index.html", "--line-numbers", "--main", "README.rdoc", "--inline-source"]

s.required_ruby_version = ">= 1.8.4"
Expand Down
2 changes: 1 addition & 1 deletion examples/imdb/create_neo_db.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def parse_actors(file)
DB_NEO_DIR = File.expand_path(File.dirname(__FILE__) + "/db/neo")
DB_LUCENE_DIR = File.expand_path(File.dirname(__FILE__) + "/db/lucene")

Neo4j.start DB_NEO_DIR, DB_LUCENE_DIR
Neo4j.start DB_NEO_DIR #, DB_LUCENE_DIR

require "model"

Expand Down
2 changes: 1 addition & 1 deletion examples/imdb/find_actors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
DB_NEO_DIR = File.expand_path(File.dirname(__FILE__) + "/db/neo")
DB_LUCENE_DIR = File.expand_path(File.dirname(__FILE__) + "/db/lucene")

Neo4j.start DB_NEO_DIR, DB_LUCENE_DIR
Neo4j.start DB_NEO_DIR #, DB_LUCENE_DIR

require "model"

Expand Down
2 changes: 1 addition & 1 deletion lib/lucene/field_info.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def java_field(key, value)
store = store? ? org.apache.lucene.document.Field::Store::YES : org.apache.lucene.document.Field::Store::NO
cvalue = convert_to_lucene(value)
token_type = tokenized? ? org.apache.lucene.document.Field::Index::ANALYZED : org.apache.lucene.document.Field::Index::NOT_ANALYZED
$LUCENE_LOGGER.debug{"java_field store=#{store} key='#{key.to_s}' value='#{cvalue}' type=#{token_type}"}
$LUCENE_LOGGER.debug{"java_field store=#{store} key='#{key.to_s}' value='#{cvalue}' token_type=#{token_type}"}
org.apache.lucene.document.Field.new(key.to_s, cvalue, store, token_type ) #org.apache.lucene.document.Field::Index::NO_NORMS)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/lucene/index_searcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ def exist?
end

end
end
end
2 changes: 1 addition & 1 deletion lib/neo4j/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Neo4j
VERSION = '0.0.4' unless defined?(Neo4j::VERSION)
VERSION = '0.0.5' unless defined?(Neo4j::VERSION)
end
78 changes: 43 additions & 35 deletions neo4j.gemspec
Original file line number Diff line number Diff line change
@@ -1,77 +1,85 @@
# WARNING : RAKE AUTO-GENERATED FILE. DO NOT MANUALLY EDIT!
# LAST UPDATED : Thu Oct 23 15:05:22 +0200 2008
# LAST UPDATED : Mon Nov 17 22:57:34 +0100 2008
#
# RUN : 'rake gem:update_gemspec'

Gem::Specification.new do |s|
s.description = "A graph database for JRuby"
s.files = ["LICENSE",
"CHANGELOG",
"README.rdoc",
"TODO",
"Rakefile",
"neo4j.gemspec",
"lib/lucene.rb",
"lib/neo4j.rb",
"lib/lucene",
"lib/lucene.rb",
"lib/neo4j",
"lib/inflector.rb",
"lib/inflector",
"lib/lucene/query_dsl.rb",
"lib/lucene/index_info.rb",
"lib/lucene/jars",
"lib/lucene/field_info.rb",
"lib/lucene/jars.rb",
"lib/lucene/index_searcher.rb",
"lib/lucene/index.rb",
"lib/lucene/hits.rb",
"lib/lucene/query_dsl.rb",
"lib/lucene/document.rb",
"lib/lucene/transaction.rb",
"lib/lucene/hits.rb",
"lib/lucene/jars.rb",
"lib/lucene/jars",
"lib/lucene/field_info.rb",
"lib/lucene/field_infos.rb",
"lib/lucene/jars/lucene-core-2.3.2.jar",
"lib/neo4j/transaction.rb",
"lib/neo4j/jars.rb",
"lib/neo4j/dynamic_accessor.rb",
"lib/neo4j/neo.rb",
"lib/neo4j/jars",
"lib/lucene/jars/lucene-core-2.4.0.jar",
"lib/neo4j/reference_node.rb",
"lib/neo4j/mixins",
"lib/neo4j/version.rb",
"lib/neo4j/relations.rb",
"lib/neo4j/node.rb",
"lib/neo4j/relation_info.rb",
"lib/neo4j/transactional.rb",
"lib/neo4j/jars",
"lib/neo4j/events.rb",
"lib/neo4j/jars/neo-1.0-b7.jar",
"lib/neo4j/jars.rb",
"lib/neo4j/neo.rb",
"lib/neo4j/transaction.rb",
"lib/neo4j/relations",
"lib/neo4j/mixins/transactional.rb",
"lib/neo4j/mixins/node.rb",
"lib/neo4j/mixins/relation.rb",
"lib/neo4j/mixins/dynamic_accessor.rb",
"lib/neo4j/jars/jta-spec1_0_1.jar",
"lib/inflector/inflections.rb",
"lib/inflector/inflection.rb",
"lib/neo4j/jars/neo-1.0-b7.jar",
"lib/neo4j/jars/shell-1.0-b7.jar",
"lib/neo4j/relations/relations.rb",
"lib/neo4j/relations/relation_info.rb",
"lib/neo4j/relations/dynamic_relation.rb",
"lib/neo4j/relations/has_n_relations.rb",
"lib/neo4j/relations/relation_traverser.rb",
"test/lucene",
"test/neo4j",
"test/tmp",
"test/lucene/transaction_spec.rb",
"test/lucene/document_spec.rb",
"test/lucene/index_spec.rb",
"test/lucene/index_info_spec.rb",
"test/lucene/query_dsl_spec.rb",
"test/lucene/field_infos_spec.rb",
"test/lucene/document_spec.rb",
"test/lucene/field_info_spec.rb",
"test/neo4j/transaction_spec.rb",
"test/lucene/index_spec.rb",
"test/neo4j/neo_spec.rb",
"test/neo4j/person_spec.rb",
"test/neo4j/order_spec.rb",
"test/neo4j/transaction_spec.rb",
"test/neo4j/spec_helper.rb",
"test/neo4j/event_spec.rb",
"test/neo4j/node_lucene_spec.rb",
"test/neo4j/order_spec.rb",
"test/neo4j/node_spec.rb",
"test/neo4j/relation_spec.rb",
"test/neo4j/var",
"test/neo4j/event_spec.rb"]
s.rubygems_version = "1.2.0"
"test/neo4j/person_spec.rb",
"examples/imdb",
"examples/imdb/install.sh",
"examples/imdb/model.rb",
"examples/imdb/find_actors.rb",
"examples/imdb/create_neo_db.rb"]
s.rubygems_version = "1.3.1"
s.platform = "ruby"
s.date = "Thu Oct 23 00:00:00 +0200 2008"
s.date = "Mon Nov 17 00:00:00 +0100 2008"
s.homepage = "http://github.com/andreasronge/neo4j/tree"
s.rubyforge_project = "neo4j"
s.bindir = "bin"
s.summary = "A graph database for JRuby"
s.rdoc_options = ["--quiet", "--title", "neo4j and lucene documentation", "--opname", "index.html", "--line-numbers", "--main", "README.rdoc", "--inline-source"]
s.specification_version = "2"
s.email = "andreas.ronge@gmail.com"
s.version = "0.0.4"
s.version = "0.0.5"
s.required_rubygems_version = ">= 0"
s.require_paths = ["lib"]
s.required_ruby_version = ">= 1.8.4"
Expand Down
17 changes: 15 additions & 2 deletions test/neo4j/node_lucene_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ class TestNode
include Neo4j::NodeMixin
properties :name, :age, :male, :height
index :name
index :age
index :age, :type => Fixnum
index :male
index :height
index :height, :type => Float
end
@foos = []
5.times {|n|
Expand All @@ -202,6 +202,9 @@ class TestNode
node.height = n * 0.1
@bars << node
}

@node100 = TestNode.new {|n| n.name = "node"; n.age = 100}

end

after(:all) do
Expand All @@ -215,6 +218,16 @@ class TestNode
found.size.should == 1
end

it "should find one node using a range" do
found = TestNode.find(:age => 0..2)
found.size.should == 6
found.should include(@foos[1])

found = TestNode.find(:age => 100)
found.size.should == 1
found.should include(@node100)
end

it "should find two nodes" do
found = TestNode.find(:age => 0)
found.should include(@foos[0])
Expand Down
2 changes: 1 addition & 1 deletion test/neo4j/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def delete_db

def start
delete_db
Neo4j.start NEO_STORAGE, LUCENE_INDEX_LOCATION
Neo4j.start NEO_STORAGE , LUCENE_INDEX_LOCATION
end


Expand Down

0 comments on commit 0e10242

Please sign in to comment.