cancel
Showing results for 
Search instead for 
Did you mean: 

SearchParameter class Query

yogeshkumar
Champ in-the-making
Champ in-the-making
Hi,

Is there any way to set the start and end index of lucene query result using SearchParameter class

Ex:

lucene query result : 20
using SearchParameter class i need to fetch only from the index 5 to 10

is that possible?

Thanks and Regards,
Yogeshkumar.S
1 REPLY 1

alcibiade
Champ in-the-making
Champ in-the-making
You can use the skipCount and limit properties of the SearchParameters class:


SearchParameters searchParameters = new SearchParameters();
searchParameters.setLanguage(SearchService.LANGUAGE_LUCENE);
searchParameters.addStore(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
searchParameters.setLimitBy(LimitBy.FINAL_SIZE);
searchParameters.setLimit(limit);
searchParameters.setSkipCount(skipCount);
searchParameters.setQuery(queryStatement);