Results 1 to 2 of 2

Thread: [Spring Data Graph] Separate full text search indices for different parts of graph?

  1. #1
    Join Date
    Aug 2011
    Posts
    22

    Exclamation [Spring Data Graph] Separate full text search indices for different parts of graph?

    Consider this code:
    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
    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?
    Last edited by loki2302; Sep 11th, 2011 at 03:14 PM.

  2. #2
    Join Date
    Jan 2011
    Location
    Dresden, Germany
    Posts
    525

    Default

    Right now you can either use the default index names which are the class-name or provide an index name in the @Indexed annotation.

    To use an index derived from properties of a set of instances, you'd have to either index the entities manually or override the IndexingPropertyFieldAccessorListener which takes care of indexing (or register your own).

    Right now it determines the index statically on the field but it can be changed so that this choice is made at runtime depending on properties of the entity.

    If you need any more help just ping us again.

    Cheers,

    Michael

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •