Hi Luca and everyone
I will describe our use case and make a question about Lucene indexes.
We developed a hybrid schema in Orientdb defining classes storing documents
(nested) and since we love Lucene indexes to enable their use we always
dump a document into a string property.
To establish the ER we use the direct approach to define Vertexes as
Entities and Edges as Relationships.
So the basic schema can be describe in oSQL:

create class Entities extends V
create property Entitites.sdoc STRING
create property Entities.location EMBEDDED OPoint
create create index Entity.location ON Entity(location) SPATIAL ENGINE
LUCENE
create index Entity.ssdoc on Entity(sdoc) FULLTEXT ENGINE LUCENE METADATA
{"allowLeadingWildcard": true}

create class Relationships extends E
create property Relationships.sdoc STRING
create index Relationships.ssdoc on Relationships(sdoc) FULLTEXT ENGINE
LUCENE METADATA {"allowLeadingWildcard": true}

So, we this schema we can do select in class leves, like in V and E, and
also in Entities and Relationships
In order to keep the hierarchy we never store data into the 4 classes
above, we always create a new class to store objects extending the two main
classes Entities and Relationships.
So, If decide to store Companies, we do something like this (Ps.: I don't
know if RETURN works for create vertex and edge but it's used to create the
example below) :

create class Companies extends Entities
create property Companies.sdoc STRING
create property Companies.location EMBEDDED OPoint
create create index Companies.location ON Companies(location) SPATIAL
ENGINE LUCENE
create index Companies.ssdoc on Companies(sdoc) FULLTEXT ENGINE LUCENE
METADATA {"allowLeadingWildcard": true}

and

Create Vertex Companies content
{'key':{'key2':'value1','keylist':[1,2,3,4]},'key3':
10,'key':[{'key4':'values'}]} RETURN @rid
update <@rid above1> set location = [-39.0,18]
update <@rid above1> set sdoc =
"{'key':{'key2':'value1','keylist':[1,2,3,4]},'key3':
10,'key':[{'key4':'values'}]}"

Create Vertex Companies content
{'key':{'key2':'value8','keylist':[4,5,6,7]},'key3':
12,'key':[{'key5':'values1'}]} RETURN @rid
update <@rid above2> set location = [-35.0,22]
update <@rid above2> set sdoc =
"{'key':{'key2':'value8','keylist':[4,5,6,7]},'key3':
12,'key':[{'key5':'values1'}]}"

Suppose that we have a contract between the two companies, so we would
create:

create class Contracts extends Relationships
create property Relationships.sdoc STRING
create index Relationships.ssdoc on Relationships(sdoc) FULLTEXT ENGINE
LUCENE METADATA {"allowLeadingWildcard": true}

create edge Contracts from <@rid above1> to <@rid above2> content
{'startdate': isoformat , 'enddata': isoformat, 'description': 'some info'}
RETURN @rid
update <@rid above3> set sdoc = "{'startdate': isoformat , 'enddata':
isoformat, 'description': 'some info'}"

So, with this info above we use lucene queries like:

select from Contracts where sdoc LUCENE 'some*'
select from Companies where sdoc LUCENE 'values'

Now, the problem:

We keeping using the database like presented above and sometimes, when we
create and drop classes, the lucene indexes stops to work and we need to
execute:

rebuild index *

And the lucene queries works again.
How I can avoid this?
Is the problem related to the indexes created in the classes Entitites and
Relationships and the fact that we extends them to create new classes?

Thanks in advace
Best regards

André Emilio Toscano

-- 

--- 
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.

Reply via email to