Examples of SenseiResult


Examples of com.senseidb.search.client.res.SenseiResult

    // [2000 TO 2002]   ==> 4455
    // (2000 TO 2002)   ==> 1443
    // (2000 TO 2002]   ==> 2907
    // [2000 TO 2002)   ==> 2991
      SenseiClientRequest request = SenseiClientRequest.builder().addSelection(Selection.range("year", "2000", "2002")).build();
      SenseiResult res = senseiServiceProxy.sendSearchRequest(request);
      assertEquals("numhits is wrong", 4455, res.getNumhits().intValue());

      request = SenseiClientRequest.builder().addSelection(Selection.range("year", "2000", "2002", false, false)).build();
      res = senseiServiceProxy.sendSearchRequest( request);
      assertEquals("numhits is wrong", 1443, res.getNumhits().intValue());

      request = SenseiClientRequest.builder().addSelection(Selection.range("year", "2000", "2002", false, true)).build();
      res = senseiServiceProxy.sendSearchRequest( request);
      assertEquals("numhits is wrong", 2907, res.getNumhits().intValue());

      request = SenseiClientRequest.builder().addSelection(Selection.range("year", "2000", "2002", true, false)).build();
      res = senseiServiceProxy.sendSearchRequest( request);
      assertEquals("numhits is wrong", 2991, res.getNumhits().intValue());
  }
View Full Code Here

Examples of com.senseidb.search.client.res.SenseiResult

  }
  @Test
  public void testMatchAllWithBoostQuery() throws Exception
  {
    SenseiClientRequest request = SenseiClientRequest.builder().query(Queries.matchAllQuery(1.2)).build();
    SenseiResult res = senseiServiceProxy.sendSearchRequest( request);
    assertEquals("numhits is wrong", 15000, res.getNumhits().intValue());
  }
View Full Code Here

Examples of com.senseidb.search.client.res.SenseiResult

  }
  @Test
  public void testQueryStringQuery() throws Exception
  {
    SenseiClientRequest request = SenseiClientRequest.builder().query(Queries.stringQuery("red AND cool")).build();
    SenseiResult res = senseiServiceProxy.sendSearchRequest( request);
    assertEquals("numhits is wrong", 1070, res.getNumhits().intValue());

  }
View Full Code Here

Examples of com.senseidb.search.client.res.SenseiResult

  @Test
  public void testUIDQuery() throws Exception
  {
    SenseiClientRequest request = SenseiClientRequest.builder().query(Queries.ids(Arrays.asList("1","2", "3"), Arrays.asList("2"), 1.0)).build();

    SenseiResult res = senseiServiceProxy.sendSearchRequest( request);


    assertEquals("numhits is wrong", 2, res.getNumhits().intValue());
    assertEquals("the first uid is wrong", 1, res.getHits().get(0).getUid().intValue());
    assertEquals("the second uid is wrong", 3, res.getHits().get(1).getUid().intValue());
  }
View Full Code Here

Examples of com.senseidb.search.client.res.SenseiResult

  }
  @Test
  public void testTextQuery() throws Exception
  {
    SenseiClientRequest request = SenseiClientRequest.builder().query(Queries.textQuery("contents", "red cool", Operator.and, 1.0)).build();
    SenseiResult res = senseiServiceProxy.sendSearchRequest( request);
    assertEquals("numhits is wrong", 1070, res.getNumhits().intValue());

  }
View Full Code Here

Examples of com.senseidb.search.client.res.SenseiResult

  }
  @Test
  public void testTermQuery() throws Exception
  {
    SenseiClientRequest request = SenseiClientRequest.builder().query(Queries.term("color", "red", 1.0)).build();
    SenseiResult res = senseiServiceProxy.sendSearchRequest( request);
    assertEquals("numhits is wrong", 2160, res.getNumhits().intValue());
  }
View Full Code Here

Examples of com.senseidb.search.client.res.SenseiResult

  }
 
  @Test
  public void testSimpleBQL() throws Exception{
    String bql = "select *  where color in ('red')";
    SenseiResult res = senseiServiceProxy.sendBQL(bql);
    assertEquals("numhits is wrong", 2160, res.getNumhits().intValue());
  }
View Full Code Here

Examples of com.senseidb.search.client.res.SenseiResult

 
  @Test
  public void testTermsQuery() throws Exception
  {
    SenseiClientRequest request = SenseiClientRequest.builder().query(Queries.terms("tags", Arrays.asList("leather", "moon-roof"), Arrays.asList("hybrid"), Operator.or, 0, 1.0)).build();
    SenseiResult res = senseiServiceProxy.sendSearchRequest( request);
    assertEquals("numhits is wrong", 5777, res.getNumhits().intValue());

  }
View Full Code Here

Examples of com.senseidb.search.client.res.SenseiResult

  @Test
  public void testBooleanQuery() throws Exception
  {
    SenseiClientRequest request = SenseiClientRequest.builder().query(
        Queries.bool(Arrays.asList((Query)Queries.term("color", "red", 1.0)), Arrays.asList((Query)Queries.term("category", "compact", 1.0)), null,  1.0)).build();
    SenseiResult res = senseiServiceProxy.sendSearchRequest( request);
    assertEquals("numhits is wrong", 1652, res.getNumhits().intValue());

  }
View Full Code Here

Examples of com.senseidb.search.client.res.SenseiResult

  {
    SenseiClientRequest request = SenseiClientRequest.builder().query(
        Queries.disMax(0.7, 1.2, Queries.term("color", "red", 1.0), Queries.term("color", "blue", 1.0))

   ).build();
    SenseiResult res = senseiServiceProxy.sendSearchRequest( request);
    assertEquals("numhits is wrong", 3264, res.getNumhits().intValue());

  }
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.