public class SearchServiceImpl extends Object implements SearchService
SearchService| Modifier and Type | Field and Description |
|---|---|
protected eu.europeana.corelib.tools.lookuptable.EuropeanaIdMongoServer |
idServer |
protected EdmMongoServer |
mongoServer |
| Constructor and Description |
|---|
SearchServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
List<org.apache.solr.client.solrj.response.FacetField.Count> |
createCollections(String facetFieldName,
String queryString,
String... refinements)
Create collection list for a given query and facet field
|
FullBean |
fetchFullBean(String europeanaObjectId)
Retrieve a record by europeanaObjectId (no further processing)
|
FullBean |
findById(String europeanaObjectId,
boolean similarItems)
Retrieve a record by id and calling processFullBean() afterwards
|
FullBean |
findById(String collectionId,
String recordId,
boolean similarItems)
Retrieves a record by collectionId and recordId and calling processFullBean() afterwards
|
List<BriefBean> |
findMoreLikeThis(String europeanaObjectId)
Deprecated.
|
List<BriefBean> |
findMoreLikeThis(String europeanaObjectId,
int count)
Deprecated.
|
Date |
getLastSolrUpdate() |
void |
logTime(String type,
long time) |
FullBean |
processFullBean(FullBean fullBean,
String europeanaObjectId,
boolean similarItems)
(optionally) adding similar items to a FullBean, etcetera
|
Map<String,Integer> |
queryFacetSearch(String query,
String[] qf,
List<String> queries) |
FullBean |
resolve(String europeanaObjectId,
boolean similarItems)
Retrieve a record by id.
|
FullBean |
resolve(String collectionId,
String recordId,
boolean similarItems)
Retrieve a record by splitted collectionId and recordId
|
String |
resolveId(String europeanaObjectId)
Checks if an europeanaObjectId is old and has a newId.
|
String |
resolveId(String collectionId,
String recordId)
Uses the provided collectionId and recordId to create an EuropeanaId and checks if that id is old and has a newId.
|
<T extends IdBean> |
search(Class<T> beanInterface,
Query query)
Perform a calculateTag in SOLR based on the given query and return the results
in the format of the given class.
|
<T extends IdBean> |
search(Class<T> beanInterface,
Query query,
boolean debug)
Perform a calculateTag in SOLR based on the given query and return the results
in the format of the given class.
|
Map<String,Integer> |
seeAlso(List<String> queries)
Returns a list of "see also" suggestions.
|
void |
setSolrClient(org.apache.solr.client.solrj.SolrClient solrClient) |
List<Term> |
suggestions(String query,
int pageSize)
Deprecated.
as of September 2018 (not working properly and very little usage)
|
List<Term> |
suggestions(String query,
int pageSize,
String field)
Deprecated.
as of September 2018
|
protected EdmMongoServer mongoServer
protected eu.europeana.corelib.tools.lookuptable.EuropeanaIdMongoServer idServer
public FullBean findById(String collectionId, String recordId, boolean similarItems) throws EuropeanaException
SearchServicefindById in interface SearchServicecollectionId - id of the collection to which this record belongssimilarItems - whether to retrieve similar itemsEuropeanaExceptionpublic FullBean findById(String europeanaObjectId, boolean similarItems) throws EuropeanaException
SearchServicefindById in interface SearchServiceeuropeanaObjectId - The unique europeana idsimilarItems - Whether to retrieve similar itemsEuropeanaExceptionpublic FullBean fetchFullBean(String europeanaObjectId) throws EuropeanaException
SearchServicefetchFullBean in interface SearchServiceeuropeanaObjectId - The unique europeana idEuropeanaExceptionpublic FullBean processFullBean(FullBean fullBean, String europeanaObjectId, boolean similarItems)
SearchServiceprocessFullBean in interface SearchServicefullBean - The FullBean to be processed (injectWebMetaInfoBatch etc.)europeanaObjectId - The unique europeana idsimilarItems - whether to retrieve similar itemspublic FullBean resolve(String collectionId, String recordId, boolean similarItems) throws SolrTypeException
SearchServiceresolve in interface SearchServicecollectionId - id of the collection to which this record belongssimilarItems - Whether to retrieve similar itemsSolrTypeExceptionSearchService.resolve(String, String, boolean)public FullBean resolve(String europeanaObjectId, boolean similarItems) throws SolrTypeException
SearchServiceresolve in interface SearchServiceeuropeanaObjectId - The unique europeana idsimilarItems - Whether to retrieve similar itemsSolrTypeExceptionSearchService.resolve(String, boolean)public String resolveId(String europeanaObjectId) throws BadDataException
SearchServiceresolveId in interface SearchServiceeuropeanaObjectId - the old record idBadDataException - if a circular id reference is foundSearchService.resolveId(String)public String resolveId(String collectionId, String recordId) throws BadDataException
SearchServiceresolveId in interface SearchServicecollectionId - the collection IdrecordId - the record IdBadDataException - if a circular id reference is foundSearchService.resolveId(String, String)@Deprecated public List<BriefBean> findMoreLikeThis(String europeanaObjectId) throws EuropeanaException
SearchServicefindMoreLikeThis in interface SearchServiceEuropeanaException@Deprecated public List<BriefBean> findMoreLikeThis(String europeanaObjectId, int count) throws EuropeanaException
SearchServicefindMoreLikeThis in interface SearchServiceEuropeanaExceptionpublic <T extends IdBean> ResultSet<T> search(Class<T> beanInterface, Query query, boolean debug) throws EuropeanaException
SearchServicesearch in interface SearchServicebeanInterface - The required bean type, should be ApiBean or BriefBeanquery - Model class containing the calculateTag specification.debug - includes the string representing the Solrquery in the ResultSetEuropeanaExceptionpublic <T extends IdBean> ResultSet<T> search(Class<T> beanInterface, Query query) throws EuropeanaException
SearchServicesearch in interface SearchServicebeanInterface - The required bean type, should be ApiBean or BriefBeanquery - Model class containing the calculateTag specification.EuropeanaException@Deprecated public List<Term> suggestions(String query, int pageSize) throws SolrTypeException
SearchServicesuggestions in interface SearchServicequery - The calculateTag term to find suggestions forpageSize - Amount of requested suggestionsSolrTypeExceptionpublic List<org.apache.solr.client.solrj.response.FacetField.Count> createCollections(String facetFieldName, String queryString, String... refinements) throws EuropeanaException
SearchServicecreateCollections in interface SearchServicefacetFieldName - The SolrFacetType field to create the collection forqueryString - The Query to use for creating the collectionrefinements - Optional refinementsEuropeanaExceptionpublic Map<String,Integer> seeAlso(List<String> queries)
SearchServiceseeAlso in interface SearchServicequeries - Map of field names, and corresponding field values.public Map<String,Integer> queryFacetSearch(String query, String[] qf, List<String> queries)
queryFacetSearch in interface SearchService@Deprecated public List<Term> suggestions(String query, int pageSize, String field)
suggestions in interface SearchServicequery - The calculateTag term to find suggestions forpageSize - Amount of requested suggestionspublic void setSolrClient(org.apache.solr.client.solrj.SolrClient solrClient)
public Date getLastSolrUpdate() throws EuropeanaException
getLastSolrUpdate in interface SearchServiceEuropeanaExceptionpublic void logTime(String type, long time)
Copyright © 2019 Europeana Foundation. All rights reserved.