Maisa Barros
Maisa Barros

Reputation: 101

How to get nextCursorMark on solr search with opencms

I'm doing a search in opencms (10.5.1) and need to use the solr cursors, but I don't know how to get the nextCursorMark with opencms.

Is there a way to get the nextCursorMark in opencms?

Upvotes: 0

Views: 127

Answers (1)

Maisa Barros
Maisa Barros

Reputation: 101

I was able to get the nextCursorMark as follows:

CmsSolrQuery squery = new CmsSolrQuery(null,
CmsRequestUtil.createParameterMap(query));               
CmsSolrResultList results = index.search(cmso, squery,true);             
SolrQuery sorlquery = results.getQuery();

String cursor = sorlquery.get("cursorMark");         
SolrClient client = new HttpSolrClient("http://localhost:9090/opencms/handleSolrSelect");
QueryResponse resp = client.query(sorlquery);                
String nextCursor = resp.getNextCursorMark();

Upvotes: 0

Related Questions