I have an Object with 3 fields in it: ObjectId ParentId ProjectId
I have my object mapped to a Lucene.NET index so each document contains the 3 fields and values for the above. I want to perform the following SQL query equivalent as a Lucene.NET search:
SELECT * FROM Objects WHERE ProjectId = @ProjectId AND (ObjectId = ParentId OR ParentId = 0);
I am given ProjectId in my method. Is this even possible or am I forced to retrieve everything for a given ProjectId and manually check the ObjectId and ParentId fields?