Package org.infinispan.query.queries.faceting

Examples of org.infinispan.query.queries.faceting.Car


      createClusteredCaches(2, cacheCfg);
   }

   public void testInitMapper() throws InterruptedException {
      cache(0).put("key1", new Car("ford", "blue", 160));
      cache(1).put("key2", new Car("bmw", "black", 160));
      cache(0).put("key3", new Car("mersedes", "white", 160));

      Map result = new MapReduceTask<Object, Object, Object, LuceneWork>(cache(0))
            .mappedWith(new SomeMapper())
            .reducedWith(new IndexingReducer())
            .execute();
View Full Code Here


      Assert.assertTrue(result.isEmpty());
   }

   public void testInitReducer () throws InterruptedException {
      cache(0).put("key1", new Car("ford", "blue", 160));
      cache(1).put("key2", new Car("bmw", "black", 160));
      cache(0).put("key3", new Car("mersedes", "white", 160));

      Map result = new MapReduceTask<Object, Object, Object, LuceneWork>(cache(0))
            .mappedWith(new IndexingMapper())
            .reducedWith(new SomeReducer())
            .execute();
View Full Code Here

            .keyword()
            .onField("make")
            .matching("ford")
            .createQuery();

      cache.put("car1", new Car("ford", "white", 300));
      cache.put("car2", new Car("ford", "blue", 300));
      cache.put("car3", new Car("ford", "red", 300));

      // ensure these were not indexed
      assertEquals(0, searchManager.getQuery(query, Car.class).getResultSize());

      //reindex
View Full Code Here

   @Test(groups = "unstable", description = "See ISPN-4043")
   public void testReindexing() throws Exception {
      for(int i = 0; i < 200; i++) {
         caches.get(i % 2).getAdvancedCache().withFlags(Flag.SKIP_INDEXING).put(key("F" + i + "NUM"),
                                                                                new Car((i % 2 == 0 ? "megane" : "bmw"), "blue", 300 + i));
      }

      //Adding also non-indexed values
      caches.get(0).getAdvancedCache().put(key("FNonIndexed1NUM"), new NotIndexedType("test1"));
      caches.get(0).getAdvancedCache().put(key("FNonIndexed2NUM"), new NotIndexedType("test2"));
View Full Code Here

      }
      waitForClusterToForm(neededCacheNames);
   }

   public void testReindexing() throws Exception {
      caches.get(0).put(key("F1NUM"), new Car("megane", "white", 300));
      verifyFindsCar(1, "megane");
      caches.get(1).put(key("F2NUM"), new Car("megane", "blue", 300));
      verifyFindsCar(2, "megane");
      //add an entry without indexing it:
      caches.get(1).getAdvancedCache().withFlags(Flag.SKIP_INDEXING).put(key("F3NUM"), new Car("megane", "blue", 300));
      verifyFindsCar(2, "megane");
      //re-sync datacontainer with indexes:
      rebuildIndexes();
      verifyFindsCar(3, "megane");
      //verify we cleanup old stale index values:
View Full Code Here

      }
      waitForClusterToForm(neededCacheNames);
   }

   public void testManualIndexing() throws Exception {
      caches.get(0).put("car A", new Car("ford", "blue", 400));
      caches.get(0).put("car B", new Car("megane", "white", 300));
      caches.get(0).put("car C", new Car("megane", "red", 500));

      assertNumberOfCars(0, "megane");
      assertNumberOfCars(0, "ford");

      // rebuild index
View Full Code Here

            .keyword()
            .onField("make")
            .matching("ford")
            .createQuery();

      cache.put("car1", new Car("ford", "white", 300));
      cache.put("car2", new Car("ford", "blue", 300));
      cache.put("car3", new Car("ford", "red", 300));

      // ensure these were not indexed
      assertEquals(0, searchManager.getQuery(query, Car.class).getResultSize());

      //reindex
View Full Code Here

public class MassIndexingTest extends DistributedMassIndexingTest {

   public void testReindexing() throws Exception {
      for(int i = 0; i < 200; i++) {
         caches.get(i % 2).getAdvancedCache().withFlags(Flag.SKIP_INDEXING).put(key("F" + i + "NUM"),
                                                                                new Car((i % 2 == 0 ? "megane" : "bmw"), "blue", 300 + i));
      }

      //Adding also non-indexed values
      caches.get(0).getAdvancedCache().put(key("FNonIndexed1NUM"), new NotIndexedType("test1"));
      caches.get(0).getAdvancedCache().put(key("FNonIndexed2NUM"), new NotIndexedType("test2"));
View Full Code Here

      }
      waitForClusterToForm(neededCacheNames);
   }

   public void testReindexing() throws Exception {
      caches.get(0).put(key("F1NUM"), new Car("megane", "white", 300));
      verifyFindsCar(1, "megane");
      caches.get(1).put(key("F2NUM"), new Car("megane", "blue", 300));
      verifyFindsCar(2, "megane");
      //add an entry without indexing it:
      caches.get(1).getAdvancedCache().withFlags(Flag.SKIP_INDEXING).put(key("F3NUM"), new Car("megane", "blue", 300));
      verifyFindsCar(2, "megane");
      //re-sync datacontainer with indexes:
      rebuildIndexes();
      verifyFindsCar(3, "megane");
      //verify we cleanup old stale index values:
View Full Code Here

         System.out.print("Using " + cacheId + ": " + cache +"\t");
         final long blockStart = System.nanoTime();
         cache.startBatch();
         for (int innerLoop = 0; innerLoop < LOG_ON_EACH; innerLoop++) {
            carId++;
            cache.put("car" + carId, new Car("megane", "blue", 300 + carId));
            carId++;
            cache.put("car" + carId, new Car("bmw", "blue", 300 + carId));
         }
         cache.endBatch(true);
         System.out.println("Inserted " + LOG_ON_EACH + " cars in " + Util.prettyPrintTime(System.nanoTime() - blockStart, TimeUnit.NANOSECONDS));
      }
      System.out.println("Test took " + Util.prettyPrintTime(System.nanoTime() - start, TimeUnit.NANOSECONDS));
View Full Code Here

TOP

Related Classes of org.infinispan.query.queries.faceting.Car

Copyright © 2018 www.massapicom. 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.