Examples of keyword()


Examples of org.hibernate.search.query.dsl.QueryBuilder.keyword()

   public void testAdditionOfNewNode() {
      prepareData();

      SearchManager sm = Search.getSearchManager(cache3);
      QueryBuilder qb = sm.buildQueryBuilderForClass(VeryLongIndexNamedClass.class).get();
      Query q = qb.keyword().wildcard().onField("name").matching("value*").createQuery();
      CacheQuery cq = sm.getQuery(q, VeryLongIndexNamedClass.class);

      assertEquals(100, cq.getResultSize());

      addClusterEnabledCacheManager(getDefaultConfiguration());
View Full Code Here

Examples of org.hibernate.search.query.dsl.QueryBuilder.keyword()

      addClusterEnabledCacheManager(getDefaultConfiguration());
      TestingUtil.waitForRehashToComplete(cache(0), cache(1), cache(2), cache(3));

      sm = Search.getSearchManager(cache(3));
      qb = sm.buildQueryBuilderForClass(VeryLongIndexNamedClass.class).get();
      q = qb.keyword().wildcard().onField("name").matching("value*").createQuery();
      cq = sm.getQuery(q, VeryLongIndexNamedClass.class);

      assertEquals(100, cq.getResultSize());
   }

View Full Code Here

Examples of org.hibernate.search.query.dsl.QueryBuilder.keyword()

   }

   private static void assertFindBook(Cache<Object, Object> cache) {
      SearchManager searchManager = Search.getSearchManager(cache);
      QueryBuilder queryBuilder = searchManager.buildQueryBuilderForClass(Book.class).get();
      Query luceneQuery = queryBuilder.keyword().onField("title").matching("infinispan").createQuery();
      CacheQuery cacheQuery = searchManager.getQuery(luceneQuery);
      List<Object> list = cacheQuery.list();
      assertEquals(1, list.size());
   }
View Full Code Here

Examples of org.hibernate.search.query.dsl.QueryBuilder.keyword()

      assertQueryReturns(cacheQuery, new Object[] { "1", foo, foo, foo.getClass(), foo.baz, foo.bar });
   }

   private CacheQuery createProjectionQuery(String... projection) {
      QueryBuilder queryBuilder = searchManager.buildQueryBuilderForClass(Foo.class).get();
      Query query = queryBuilder.keyword().onField("bar").matching("bar1").createQuery();
      CacheQuery cacheQuery = searchManager.getQuery(query);
      cacheQuery.projection(projection);
      return cacheQuery;
   }
View Full Code Here

Examples of org.hibernate.search.query.dsl.QueryBuilder.keyword()

   }

   protected void verifyFindsCar(Cache cache, int expectedCount, String carMake) {
      SearchManager searchManager = Search.getSearchManager(cache);
      QueryBuilder carQueryBuilder = searchManager.buildQueryBuilderForClass(Car.class).get();
      Query fullTextQuery = carQueryBuilder.keyword().onField("make").matching(carMake).createQuery();
      CacheQuery cacheQuery = searchManager.getQuery(fullTextQuery, Car.class);
      Assert.assertEquals(expectedCount, cacheQuery.getResultSize());
   }
}
View Full Code Here

Examples of org.hibernate.search.query.dsl.QueryBuilder.keyword()

   }

   private void verifyFindsCar(Cache cache, int expectedCount, String carMake) {
      SearchManager searchManager = Search.getSearchManager(cache);
      QueryBuilder carQueryBuilder = searchManager.buildQueryBuilderForClass(Car.class).get();
      Query fullTextQuery = carQueryBuilder.keyword().onField("make").matching(carMake).createQuery();
      CacheQuery cacheQuery = searchManager.getQuery(fullTextQuery, Car.class);
      assertEquals(expectedCount, cacheQuery.getResultSize());
   }

   /**
 
View Full Code Here

Examples of org.hibernate.search.query.dsl.QueryBuilder.keyword()

      if (!cache.getCacheConfiguration().compatibility().enabled()) {
         // restrict on entity type
         QueryBuilder qb = searchFactory.buildQueryBuilder().forEntity(parsingResult.getTargetEntity()).get();
         luceneQuery = qb.bool()
               .must(qb.keyword().onField(TYPE_FIELD_NAME)
                           .ignoreFieldBridge()
                           .ignoreAnalyzer()
                           .matching(parsingResult.getTargetEntityName()).createQuery())
               .must(luceneQuery)
               .createQuery();
View Full Code Here

Examples of org.hibernate.search.query.dsl.QueryBuilder.keyword()

      if (!cache.getCacheConfiguration().compatibility().enabled()) {
         // restrict on entity type
         QueryBuilder qb = searchFactory.buildQueryBuilder().forEntity(parsingResult.getTargetEntity()).get();
         luceneQuery = qb.bool()
               .must(qb.keyword().onField(TYPE_FIELD_NAME)
                           .ignoreFieldBridge()
                           .ignoreAnalyzer()
                           .matching(parsingResult.getTargetEntityName()).createQuery())
               .must(luceneQuery)
               .createQuery();
View Full Code Here

Examples of org.hibernate.search.query.dsl.QueryBuilder.keyword()

    @Override
    @Transactional(propagation = Propagation.REQUIRED, readOnly = true)
    public List fullTextSearch(String filter) {
        FullTextEntityManager fullTextEntityManager = Search.getFullTextEntityManager(entityManager);
        QueryBuilder qb = fullTextEntityManager.getSearchFactory().buildQueryBuilder().forEntity(Question.class).get();
        org.apache.lucene.search.Query query = qb
                .keyword()
                .onFields("title", "text", "comments.text")
                .matching(filter)
                .createQuery();
View Full Code Here

Examples of org.jooq.RenderContext.keyword()

                        }
                    }

                    // If the above failed, then we're dealing with a {keyword}
                    catch (NumberFormatException e) {
                        render.keyword(token);
                    }
                }
            }

            // Any other character
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.