2 Replies Latest reply on Mar 9, 2016 3:23 PM by n.dobryukha

    Case Insensitive querying via HotRod

    n.dobryukha

      Hey guys!

      Is there a possibility to use non case sensitive querying via hotrod with Infinispan 8.1.2?

      For example something like that:

       

      RemoteCacheManager remoteCacheManager = ...;
      RemoteCache<Integer, Book> remoteCache = remoteCacheManager.getCache();

      Book book1 = new Book();
      book1.setTitle("Hibernate");
      remoteCache.put(1, book1);

      Book book2 = new Book();
      book2.setTile("Infinispan");
      remoteCache.put(2, book2);

      QueryFactory qf = Search.getQueryFactory(remoteCache);
      Query query = qf.from(Book.class)
        .having("title").in("infinispan").toBuilder()
        .build();

      List<Book> list = query.list(); // Voila! We have our book back from the cache!

        • 1. Re: Case Insensitive querying via HotRod
          anistor

          Hi Nikita,

           

          Full-text features are not currently available with remote query.

           

          But you can do that in embedded mode by doing full-text search with SearchManager.getQuery(...) provided that your entity class is annotated to use the proper analyzers.

           

          The queries built with the DSL QueryFactory disallow analyzers on purpose in embedded mode (org.hibernate.hql.ParsingException thrown during execution). And in remote mode there is no way define analyzers.

           

          We are discussing the addition of full-text search features for remote protocols in a future version.

           

          Adrian

          • 2. Re: Case Insensitive querying via HotRod
            n.dobryukha

            Hi Adrian,

            Thanks for your answer.

            We've been using an embedded mode in our App before. But now we are exploring the possibilities of using shared cache for various apps.