Pagination with Elastic Search in Titan Pagination with Elastic Search in Titan elasticsearch elasticsearch

Pagination with Elastic Search in Titan


parameters are not yet supported. The method only exists for future implementations.However, you can currently limit your result. The following code should work:

Iterable<Result<Vertex>> vertices = g.indexQuery("search","v.testTitle:(mytext)")            .limit(2).vertices();    for (Result<Vertex> result : vertices) {    Vertex tv = result.getElement();    System.out.println(tv.getProperty("testTitle")+ ": " + result.getScore());}

...but you can't specify an offset.

Cheers,Daniel


I don know anyrthing about titan.But for implementing pagination concept in Elasticsearch ,you can use scroll concept.It will help a lot and Its like db cursor.. it reduces CPU usage a lot.

Refer http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-scroll.html