* Execute Lucene index query.
*/
private QueryResponse executeQuery(AdvancedCache<byte[], byte[]> cache, SerializationContext serCtx, QueryRequest request) {
final SearchManager searchManager = Search.getSearchManager(cache);
final SearchFactoryIntegrator searchFactory = (SearchFactoryIntegrator) searchManager.getSearchFactory();
final QueryCache queryCache = ComponentRegistryUtils.getQueryCache(cache); // optional component
LuceneQueryParsingResult parsingResult;
Query luceneQuery;
if (queryCache != null) {
KeyValuePair<String, Class> queryCacheKey = new KeyValuePair<String, Class>(request.getJpqlString(), LuceneQueryParsingResult.class);
parsingResult = queryCache.get(queryCacheKey);
if (parsingResult == null) {
parsingResult = parseQuery(cache, serCtx, request.getJpqlString(), searchFactory);
queryCache.put(queryCacheKey, parsingResult);
}
} else {
parsingResult = parseQuery(cache, serCtx, request.getJpqlString(), searchFactory);
}