Hi,
I'm trying to get my head around how to make Lucene work on top of fields
that have server-side hooks altering their values - I'm using OrientDB
2.0.8.
Here's my scenario:
1. I define a small schema that includes
-- a VertexType (let's say Student)
-- a String property on the Student vertex type - let's say 'name'
-- a Lucene index on this 'name' property
2. I implement ODocumentHookAbstract as follows:
-- in constructor I include: setIncludeClasses("Student")
-- onRecordBeforeCreate -- I encrypt the 'name' property if it's not NULL
-- onRecordBeforeUpdate -- I encrypt the 'name' property if it's not NULL
(as in the case of the previous method); I return RESULT.RECORD_CHANGED
-- onRecordBeforeRead -- I decrypt the 'name' property and
return RESULT.RECORD_CHANGED
3. I seed the DB with some 'Students'
4. I try to run a query of the form: SELECT * FROM Student WHERE name
LUCENE 'prefix*'
Assuming that I have student named 'John', my expectation was for the query
to return 'John' if the provided 'prefix' was 'Jo' - hence going through
the encryption-decryption phase transparently. However, this does not
happen - i.e., the query does not return John. On the other hand, if I
query for the encrypted value of John, I am able to retrieve it.
Could you please give me an idea of what am I doing wrong in this scenario?
Basically, what I want is to hide the encryption step, but still to be able
to query a full-text index as if encryption was not there.
Thank you!
Tudor
--
---
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.