Hi,
I thought I read the manual about indexing carefully and was impressed how
Indexing works in OrientDB.
Implemented the basic concepts in ActiveOrient and started testing.
When using a plain Class (TestModel) this test works perfect.
135 context "ActiveRecord mimics" do
136 before(:all){ (0..45).each{|x| TestModel.create test: x }}
(..)
144 it "get a set of documents queried by where" do
147 nr_23= TestModel.where test: 23
148 expect( nr_23 ).to have(1).item
149 expect( nr_23.first.test).to eq 23
150 end
But - if I create a composite Index:
74 it "create several properties with a composite index" do
75 @r.open_class :industry
76 @r.delete_class 'index_test'
77 TestIndex = @r.open_class "index_test"
78 TestIndex.create_properties( test: {type: :integer},
79 symbol: { type: :string },
80 industries: { type: 'LINKMAP',
linked_class: 'Industry' } ) do
81 { test_ind: :unique } # <<< this
block creates a composite Index covering all properties just created i.e.
test,symbol,industries
82 end
83 expect( TestIndex.get_properties[:properties] ).to have(3).items
84 expect( TestIndex.get_properties[:indexes] ).to have(1).item
85 end
86
87 it "put some data into the class" do
88
89 (0..45).each{|x| TestIndex.create test: x }
90 expect( TestIndex.count ).to eq 46
91 expect( TestIndex.where test: 23 ).to have(1).item
92 end
93 end
The submitted query (Row 91)
select from IndexTest where test = 23
does not return any record.
I thought, a composite Index is an addition to the class, enabling fast
queries covering all index-components. Simple non-index-based queries
should work as in case of the index-free-class. But it didn't.
Is this the desired behaviour? How to proceed, if a plain property is
subject of a query in presence of a composite-index?
--
---
You received this message because you are subscribed to the Google Groups
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.