Consider this code:
What's the right approach for docs1 and docs2? The third one, I believe, is just about having @Indexed with full text search flag, but what about others? In other words, is it possible to create indices based on objects (sets of objects) and not on classes?Code:@EntityNode class Document {...}; // just a text @EntityNode class User {...}; // every user has its own documents and its friends User user1 = userRepository.findByPropertyValue("name", "user1"); Iterable<Document> docs1 = documentsRepository.findSingleUserDocumentsByTitle(user1, "title here"); // only considering user1's documents Iterable<Document> docs2 = documentsRepository.findOwnAndFriendsDocumentsByTitle(user1, "title here"); // user1 itself and its friends Iterable<Document> docs3 = documentsRepository.findAllDocuments("title here"); // looking EVERYWHERE


Reply With Quote