/**
* Performs search using Data API.
*/
protected SearchResult performSearch(SearchRequest searchRequest, ParticipantId user) {
OperationQueue opQueue = new OperationQueue();
opQueue.search(searchRequest.getQuery(), searchRequest.getIndex(),
searchRequest.getNumResults());
OperationContextImpl context =
new OperationContextImpl(waveletProvider,
converterManager.getEventDataConverter(ProtocolVersion.DEFAULT), conversationUtil);
LOG.fine(
"Performing query: " + searchRequest.getQuery() + " [" + searchRequest.getIndex() + ", "
+ (searchRequest.getIndex() + searchRequest.getNumResults()) + "]");
OperationRequest operationRequest = opQueue.getPendingOperations().get(0);
String opId = operationRequest.getId();
OperationUtil.executeOperation(operationRequest, operationRegistry, context, user);
JsonRpcResponse jsonRpcResponse = context.getResponses().get(opId);
SearchResult searchResult =
(SearchResult) jsonRpcResponse.getData().get(ParamsProperty.SEARCH_RESULTS);