Package com.senseidb.search.client.res

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


    SenseiClientRequest request = SenseiClientRequest.builder().query(
        Queries.spanNear(Arrays.asList(Queries.spanTerm("contents", "red"), Queries.spanTerm("contents", "compact"), Queries.spanTerm("contents", "favorite")), 0, true, false, 1.0)

   ).build();
    System.out.println(JsonSerializer.serialize(request));
    SenseiResult res = senseiServiceProxy.sendSearchRequest( request);
    assertEquals("numhits is wrong", 63, res.getNumhits().intValue());

  }
View Full Code Here


    SenseiClientRequest request = SenseiClientRequest.builder().query(
       Queries.spanFirst(Queries.spanTerm("color", "red"), 2, 1.0)

   ).build();
    System.out.println(JsonSerializer.serialize(request));
    SenseiResult res = senseiServiceProxy.sendSearchRequest( request);
    assertEquals("numhits is wrong", 2160, res.getNumhits().intValue());

  }
View Full Code Here

  @Test
  public void testUIDFilter() throws Exception
  {
    SenseiClientRequest request = SenseiClientRequest.builder().filter(Filters.ids(Arrays.asList("1","2", "3"), Arrays.asList("2"))).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

    SenseiClientRequest request = SenseiClientRequest.builder().filter(
       Filters.and(Filters.term("tags", "mp3") , Filters.term("color", "red"))

   ).build();
    System.out.println(JsonSerializer.serialize(request));
    SenseiResult res = senseiServiceProxy.sendSearchRequest( request);
    assertEquals("numhits is wrong", 439, res.getNumhits().intValue());

  }
View Full Code Here

    SenseiClientRequest request = SenseiClientRequest.builder().filter(
       Filters.or(Filters.term("color", "blue") , Filters.term("color", "red"))

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

  }
View Full Code Here

  public void testBooleanFilter() throws Exception
  {
    SenseiClientRequest request = SenseiClientRequest.builder().filter(
        Filters.bool(Arrays.asList((Filter)Filters.term("color", "red")), Arrays.asList((Filter)Filters.term("category", "compact")), Arrays.asList((Filter)Filters.term("color", "red")))
    ).build();
    SenseiResult res = senseiServiceProxy.sendSearchRequest( request);
    assertEquals("numhits is wrong", 1652, res.getNumhits().intValue());

  }
View Full Code Here

    SenseiClientRequest request = SenseiClientRequest.builder().filter(
       Filters.query(Queries.range("year", "1999", "2000",true, true, 1.0, false))

   ).build();
    System.out.println(JsonSerializer.serialize(request));
    SenseiResult res = senseiServiceProxy.sendSearchRequest( request);
    assertEquals("numhits is wrong", 3015, res.getNumhits().intValue());

  }
View Full Code Here

    SenseiClientRequest request = SenseiClientRequest.builder().filter(
       Filters.term("color", "red")

   ).build();
    System.out.println(JsonSerializer.serialize(request));
    SenseiResult res = senseiServiceProxy.sendSearchRequest( request);
    assertEquals("numhits is wrong", 2160, res.getNumhits().intValue());

  }
View Full Code Here

  {
    SenseiClientRequest request = SenseiClientRequest.builder().showOnlyFields("color")

   .build();
    System.out.println(JsonSerializer.serialize(request));
    SenseiResult res = senseiServiceProxy.sendSearchRequest( request);
    assertEquals( 1, res.getHits().get(0).getFieldValues().size());

  }
View Full Code Here

    SenseiClientRequest request = SenseiClientRequest.builder().filter(
       Filters.terms("tags", Arrays.asList("leather", "moon-roof"), Arrays.asList("hybrid"),Operator.or)

   ).build();
    System.out.println(JsonSerializer.serialize(request));
    SenseiResult res = senseiServiceProxy.sendSearchRequest( request);
    assertEquals("numhits is wrong", 5777, res.getNumhits().intValue());

  }
View Full Code Here

TOP

Related Classes of com.senseidb.search.client.res.SenseiResult

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.