Evolve indexing on existing repository data











up vote
0
down vote

favorite
1












I've below data in Redis and I've Address as model class which has two fields street and city. I've data which has @Indexed on street fields and redis only contains indexed data on street. Now, I want @Indexed to be applied on the data present in the Redis data. How can I do that ?



127.0.0.1:6379> KEYS *
1) "employees:d15be3e8-7662-40bb-ac4e-7b000e6391ec"
2) "employees:d15be3e8-7662-40bb-ac4e-7b000e6391ec:idx"
3) "employees:id:d15be3e8-7662-40bb-ac4e-7b000e6391ec"
4) "employees"
5) "employees:addresses.street:ABC Street"
6) "employees:addresses.street:XYZ Street"


In model class I applied @Indexed on city, now my modelled becomes like



Address.java



@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Address {
@Indexed
private String street;
@Indexed
private String city;
}


Employee.java



@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
@RedisHash("employees")
public class Employee {
@Id @Indexed
private String id;
private String firstName;
private String lastName;
private List<Address> addresses;
}


Now, unless I don't put indexing on redis actual data, List<Employee> findByAddresses_City(String city); doesn't fetches the result.



How can I do that ? I cant wipe out the exsisting data and create new. Any quick help ?



enter image description here



Ref: https://jira.spring.io/browse/DATAREDIS-894










share|improve this question




























    up vote
    0
    down vote

    favorite
    1












    I've below data in Redis and I've Address as model class which has two fields street and city. I've data which has @Indexed on street fields and redis only contains indexed data on street. Now, I want @Indexed to be applied on the data present in the Redis data. How can I do that ?



    127.0.0.1:6379> KEYS *
    1) "employees:d15be3e8-7662-40bb-ac4e-7b000e6391ec"
    2) "employees:d15be3e8-7662-40bb-ac4e-7b000e6391ec:idx"
    3) "employees:id:d15be3e8-7662-40bb-ac4e-7b000e6391ec"
    4) "employees"
    5) "employees:addresses.street:ABC Street"
    6) "employees:addresses.street:XYZ Street"


    In model class I applied @Indexed on city, now my modelled becomes like



    Address.java



    @Builder
    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public class Address {
    @Indexed
    private String street;
    @Indexed
    private String city;
    }


    Employee.java



    @Builder
    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @RedisHash("employees")
    public class Employee {
    @Id @Indexed
    private String id;
    private String firstName;
    private String lastName;
    private List<Address> addresses;
    }


    Now, unless I don't put indexing on redis actual data, List<Employee> findByAddresses_City(String city); doesn't fetches the result.



    How can I do that ? I cant wipe out the exsisting data and create new. Any quick help ?



    enter image description here



    Ref: https://jira.spring.io/browse/DATAREDIS-894










    share|improve this question


























      up vote
      0
      down vote

      favorite
      1









      up vote
      0
      down vote

      favorite
      1






      1





      I've below data in Redis and I've Address as model class which has two fields street and city. I've data which has @Indexed on street fields and redis only contains indexed data on street. Now, I want @Indexed to be applied on the data present in the Redis data. How can I do that ?



      127.0.0.1:6379> KEYS *
      1) "employees:d15be3e8-7662-40bb-ac4e-7b000e6391ec"
      2) "employees:d15be3e8-7662-40bb-ac4e-7b000e6391ec:idx"
      3) "employees:id:d15be3e8-7662-40bb-ac4e-7b000e6391ec"
      4) "employees"
      5) "employees:addresses.street:ABC Street"
      6) "employees:addresses.street:XYZ Street"


      In model class I applied @Indexed on city, now my modelled becomes like



      Address.java



      @Builder
      @Data
      @AllArgsConstructor
      @NoArgsConstructor
      public class Address {
      @Indexed
      private String street;
      @Indexed
      private String city;
      }


      Employee.java



      @Builder
      @Data
      @AllArgsConstructor
      @NoArgsConstructor
      @RedisHash("employees")
      public class Employee {
      @Id @Indexed
      private String id;
      private String firstName;
      private String lastName;
      private List<Address> addresses;
      }


      Now, unless I don't put indexing on redis actual data, List<Employee> findByAddresses_City(String city); doesn't fetches the result.



      How can I do that ? I cant wipe out the exsisting data and create new. Any quick help ?



      enter image description here



      Ref: https://jira.spring.io/browse/DATAREDIS-894










      share|improve this question















      I've below data in Redis and I've Address as model class which has two fields street and city. I've data which has @Indexed on street fields and redis only contains indexed data on street. Now, I want @Indexed to be applied on the data present in the Redis data. How can I do that ?



      127.0.0.1:6379> KEYS *
      1) "employees:d15be3e8-7662-40bb-ac4e-7b000e6391ec"
      2) "employees:d15be3e8-7662-40bb-ac4e-7b000e6391ec:idx"
      3) "employees:id:d15be3e8-7662-40bb-ac4e-7b000e6391ec"
      4) "employees"
      5) "employees:addresses.street:ABC Street"
      6) "employees:addresses.street:XYZ Street"


      In model class I applied @Indexed on city, now my modelled becomes like



      Address.java



      @Builder
      @Data
      @AllArgsConstructor
      @NoArgsConstructor
      public class Address {
      @Indexed
      private String street;
      @Indexed
      private String city;
      }


      Employee.java



      @Builder
      @Data
      @AllArgsConstructor
      @NoArgsConstructor
      @RedisHash("employees")
      public class Employee {
      @Id @Indexed
      private String id;
      private String firstName;
      private String lastName;
      private List<Address> addresses;
      }


      Now, unless I don't put indexing on redis actual data, List<Employee> findByAddresses_City(String city); doesn't fetches the result.



      How can I do that ? I cant wipe out the exsisting data and create new. Any quick help ?



      enter image description here



      Ref: https://jira.spring.io/browse/DATAREDIS-894







      spring redis jedis spring-data-redis reddison






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 23 at 15:13

























      asked Nov 20 at 14:57









      PAA

      2,45021935




      2,45021935





























          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53395739%2fevolve-indexing-on-existing-repository-data%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53395739%2fevolve-indexing-on-existing-repository-data%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          404 Error Contact Form 7 ajax form submitting

          How to know if a Active Directory user can login interactively

          Refactoring coordinates for Minecraft Pi buildings written in Python