Java Client API

A thin Java wrapper around the Rest API

Javadoc »

The Sensei Java client API is a set of builders that construct a Sensei request object.


  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);


More examples »