The Sensei Java client API is a set of builders that construct a Sensei request object.
Example:
SenseiClientRequest senseiRequest = SenseiClientRequest.Builder.paging(0,10). // paging .addSelection(Selection.terms("color","red")) // select on color = red .addSelection(Selection.range("price","*","2000")) // select on range < 2000 .addSort(Sort.desc("color")) // sort by color in descending order .addFacet("category",Facet.builder().max(5).build()) // facet on category with max 5 facet vals .query(Queries.stringQuery("cool")).build(); // text query: cool SenseiResult senseiResult = new SenseiServiceProxy() .sendRequest("http://localhost:8079/sensei/", senseiRequest); // perform query // getting documents from a list of uids Map<Long,JSONObject> docs = new SenseiServiceProxy().sendGetRequest(13,12,15);
Download
Maven:
<dependency> <groupId>com.senseidb</groupId> <artifactId>sensei-java-client</artifactId> <version>1.0.0</version> </depedency>