Project

General

Profile

1
package eu.dnetlib.index.query;
2

    
3
import org.apache.solr.client.solrj.response.QueryResponse;
4

    
5
import eu.dnetlib.clients.index.client.IndexClientException;
6
import eu.dnetlib.clients.index.query.IndexQueryResponse;
7
import eu.dnetlib.clients.index.query.QueryResponseFactory;
8
import eu.dnetlib.clients.index.query.QueryResponseParser;
9
import eu.dnetlib.utils.MetadataReference;
10

    
11
/**
12
 * The Class SolrIndexQueryResponseFactory.
13
 */
14
public class SolrIndexQueryResponseFactory extends QueryResponseFactory<QueryResponse> {
15

    
16
	/**
17
	 * {@inheritDoc}
18
	 * 
19
	 * @throws IndexClientException
20
	 *
21
	 * @see QueryResponseFactory#getQueryResponseParser(IndexQueryResponse,
22
	 *      MetadataReference)
23
	 */
24
	@Override
25
	public QueryResponseParser getQueryResponseParser(final IndexQueryResponse<QueryResponse> queryRsp, final MetadataReference mdRef)
26
			throws IndexClientException {
27

    
28
		QueryResponse response = queryRsp.getContextualQueryResponse();
29
		return new SolrResponseParser(highlightUtils, browseAliases.get(mdRef), returnEmptyFields, includeRanking, response);
30
	}
31

    
32
}
(4-4/5)