Examples of SearchManager


Examples of org.infinispan.query.SearchManager

                     "Paolo Perrotta",
                     "The Pragmatic Programmers"));

      CountingClassLoader classLoader = new CountingClassLoader();
      AdvancedCache<Object, Object> applicationCache = cache.getAdvancedCache().with(classLoader);
      SearchManager qf = Search.getSearchManager(applicationCache);

      assert classLoader.countInvocations.get() == 0;

      Query query = qf.buildQueryBuilderForClass(Book.class)
         .get()
            .phrase()
               .onField("title")
               .sentence("in action")
            .createQuery();

      List<Object> list = qf.getQuery(query).list();
      assert list.size() == 2;
      int invocationsCount = classLoader.countInvocations.get();
      assert invocationsCount >= 1 : "Received instead " + invocationsCount + " invocations";
   }
View Full Code Here

Examples of org.infinispan.query.SearchManager

      }
   }

   private boolean isMasterNode(Cache cache) {
      //Implicitly verifies the components are setup as configured by casting:
      SearchManager searchManager = Search.getSearchManager(cache);
      SearchFactoryImplementor searchFactory = (SearchFactoryImplementor) searchManager.getSearchFactory();
      InfinispanIndexManager indexManager = (InfinispanIndexManager) searchFactory.getAllIndexesManager().getIndexManager("person");
      InfinispanCommandsBackend commandsBackend = indexManager.getRemoteMaster();
      return commandsBackend.isMasterLocal();
   }
View Full Code Here

Examples of org.infinispan.query.SearchManager

      return commandsBackend.isMasterLocal();
   }

   protected void assertIndexSize(int expectedIndexSize) {
      for (Cache cache : caches) {
         SearchManager searchManager = Search.getSearchManager(cache);
         CacheQuery query = searchManager.getQuery(new MatchAllDocsQuery(), Person.class);
         Assert.assertEquals(expectedIndexSize, query.list().size());
      }
   }
View Full Code Here

Examples of org.infinispan.query.SearchManager

      Assert.fail("Expected to find interceptor " + interceptor + " among custom interceptors of cache, but it was not there.");
   }

   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();
      Assert.assertEquals(1, list.size());
   }
View Full Code Here

Examples of org.infinispan.query.SearchManager

   @Test(expectedExceptions = IllegalArgumentException.class)
   public void testSearchWithWrongCache() throws ParseException {
      Cache cache = mock(CacheImpl.class);
      when(cache.getAdvancedCache()).thenReturn(null);

      SearchManager manager = Search.getSearchManager(cache);
   }
View Full Code Here

Examples of org.infinispan.query.SearchManager

      withCacheManager(new CacheManagerCallable(
            TestCacheManagerFactory.createCacheManager(builder)) {
         @Override
         public void call() {
            final Cache<Long, BondPVO> cache = cm.getCache();
            final SearchManager sm = Search.getSearchManager(cache);

            final BondPVO bond = new BondPVO(1, "Test", "DE000123");
            cache.put(bond.getId(), bond);

            final QueryBuilder qb = sm.buildQueryBuilderForClass(BondPVO.class).get();
            final Query q = qb.keyword().onField("name").matching("Test")
                  .createQuery();
            final CacheQuery cq = sm.getQuery(q, BondPVO.class);
            Assert.assertEquals(cq.getResultSize(), 1);
         }
      });
   }
View Full Code Here

Examples of org.jmule.core.searchmanager.SearchManager

        search_query.setMaximalSize(maxFileSize);
      }
       
    }
   
    SearchManager manager = _core.getSearchManager();
    manager.search(search_query);
   
    final SearchResultTab tab = new SearchResultTab(search_query_tab_list,search_query,_core);
   
    search_query_tab_list.setSelection(tab.getSearchTab());
   
View Full Code Here

Examples of org.jmule.core.searchmanager.SearchManager

   
  }
 
  void tabClosed(SearchResultTab tab) {
    search_tabs.remove(tab);
    SearchManager manager = _core.getSearchManager();
    manager.removeSearch(tab.getSerchQuery());
  }
View Full Code Here

Examples of org.jmule.core.searchmanager.SearchManager

    // notifies that the download manager has been started
    notifyComponentStarted(servers_manager);
   
    //servers_manager.startUDPQuery();
   
    SearchManager search_manager = SearchManagerSingleton.getInstance();
   
    search_manager.initialize();
   
    search_manager.start();
   
    notifyComponentStarted(search_manager);
   
    JKadManagerSingleton.getInstance().initialize();
    try {
View Full Code Here

Examples of org.jmule.core.searchmanager.SearchManager

   
    JKadManager jkad = getJKadManager();
    if (!jkad.isDisconnected())
      jkad.disconnect();
   
    SearchManager search_manager = SearchManagerSingleton.getInstance();
   
    search_manager.shutdown();
   
    notifyComponentStopped(search_manager);
   
    ServerManagerSingleton.getInstance().shutdown();
   
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.