public class SearchServiceImpl extends Object implements SearchService
SearchService| Modifier and Type | Field and Description |
|---|---|
protected eu.europeana.corelib.tools.lookuptable.EuropeanaIdMongoServer |
idServer |
protected static org.apache.log4j.Logger |
log |
protected EdmMongoServer |
mongoServer |
protected Neo4jServer |
neo4jServer |
| 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 |
findById(String europeanaObjectId,
boolean similarItems)
Retrieve a record by id.
|
FullBean |
findById(String collectionId,
String recordId,
boolean similarItems)
Retrieve a record by splitted collectionId and recordId
|
List<BriefBean> |
findMoreLikeThis(String europeanaObjectId)
Retrieves the moreLikeThis List of BriefBeans
|
List<BriefBean> |
findMoreLikeThis(String europeanaObjectId,
int count)
Returns a specified number of moreLikeThis objects
|
List<Neo4jBean> |
getChildren(String nodeId)
Get the children of the node (max 10)
|
List<Neo4jBean> |
getChildren(String nodeId,
int offset)
Get the children of the node (max 10)
|
List<Neo4jBean> |
getChildren(String nodeId,
int offset,
int limit)
Get the children of the node (max 10)
|
long |
getChildrenCount(String nodeId)
Get the number of children this node has
|
List<Neo4jBean> |
getFollowingSiblings(String nodeId)
Get the node's 10 following siblings
|
List<Neo4jBean> |
getFollowingSiblings(String nodeId,
int limit)
Get the nodes following siblings
|
Neo4jBean |
getHierarchicalBean(String nodeId)
Get a node object
|
Neo4jStructBean |
getInitialStruct(String nodeId)
Get the initial structure, which contains self, the ancestors,
preceeding and following siblings
|
Date |
getLastSolrUpdate()
Return last modification time of Solr index
|
List<Neo4jBean> |
getPreceedingSiblings(String nodeId)
Get the nodes preceeding siblings (max 10)
|
List<Neo4jBean> |
getPreceedingSiblings(String nodeId,
int limit)
Get the nodes preceeding siblings
|
boolean |
isHierarchy(String nodeId) |
void |
logTime(String type,
long time) |
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)
Retrieve the new record Id for the redirect from the old record id
|
String |
resolveId(String collectionId,
String recordId)
Retrieve the new record Id for the redirect from the old collection id
and record id
|
<T extends IdBean> |
search(Class<T> beanInterface,
Query query)
Perform a search 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 |
setSolrServer(org.apache.solr.client.solrj.SolrServer solrServer) |
<T extends IdBean> |
sitemap(Class<T> beanInterface,
Query query)
Create a sitemap
|
List<Term> |
suggestions(String query,
int pageSize)
returns a list of search suggestions and frequencies
|
List<Term> |
suggestions(String query,
int pageSize,
String field)
Get the suggestions
|
protected static org.apache.log4j.Logger log
protected EdmMongoServer mongoServer
protected eu.europeana.corelib.tools.lookuptable.EuropeanaIdMongoServer idServer
protected Neo4jServer neo4jServer
public FullBean findById(String collectionId, String recordId, boolean similarItems) throws MongoDBException
SearchServicefindById in interface SearchServiceMongoDBExceptionpublic FullBean findById(String europeanaObjectId, boolean similarItems) throws MongoDBException
SearchServicefindById in interface SearchServiceeuropeanaObjectId - - The unique europeana idsimilarItems - - Whether to retrieve similar itemsMongoDBExceptionpublic FullBean resolve(String collectionId, String recordId, boolean similarItems) throws SolrTypeException
SearchServiceresolve in interface SearchServicesimilarItems - - Whether to retrieve similar itemsSolrTypeExceptionpublic FullBean resolve(String europeanaObjectId, boolean similarItems) throws SolrTypeException
SearchServiceresolve in interface SearchServiceeuropeanaObjectId - - The unique europeana idsimilarItems - - Whether to retrieve similar itemsSolrTypeExceptionpublic String resolveId(String europeanaObjectId)
SearchServiceresolveId in interface SearchServiceeuropeanaObjectId - - The old record idpublic String resolveId(String collectionId, String recordId)
SearchServiceresolveId in interface SearchServicecollectionId - - The collection IdrecordId - - The record Idpublic List<BriefBean> findMoreLikeThis(String europeanaObjectId) throws org.apache.solr.client.solrj.SolrServerException
SearchServicefindMoreLikeThis in interface SearchServiceorg.apache.solr.client.solrj.SolrServerExceptionpublic List<BriefBean> findMoreLikeThis(String europeanaObjectId, int count) throws org.apache.solr.client.solrj.SolrServerException
SearchServicefindMoreLikeThis in interface SearchServiceorg.apache.solr.client.solrj.SolrServerExceptionpublic <T extends IdBean> ResultSet<T> search(Class<T> beanInterface, Query query) throws SolrTypeException
SearchServicesearch in interface SearchServicebeanInterface - The required bean type, should be ApiBean or BriefBeanquery - Model class containing the search specification.SolrTypeExceptionpublic List<Term> suggestions(String query, int pageSize) throws SolrTypeException
SearchServicesuggestions in interface SearchServicequery - The search 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 SolrTypeException
SearchServicecreateCollections in interface SearchServicefacetFieldName - The Facet field to create the collection forqueryString - The Query to use for creating the collectionrefinements - Optional refinementsSolrTypeExceptionpublic Map<String,Integer> seeAlso(List<String> queries)
SearchServiceseeAlso in interface SearchServicepublic Map<String,Integer> queryFacetSearch(String query, String[] qf, List<String> queries)
queryFacetSearch in interface SearchServicepublic <T extends IdBean> ResultSet<T> sitemap(Class<T> beanInterface, Query query) throws SolrTypeException
SearchServicesitemap in interface SearchServiceSolrTypeExceptionpublic List<Term> suggestions(String query, int pageSize, String field)
suggestions in interface SearchServicequery - The search term to find suggestions forpageSize - Amount of requested suggestionspublic void setSolrServer(org.apache.solr.client.solrj.SolrServer solrServer)
public List<Neo4jBean> getChildren(String nodeId, int offset, int limit)
SearchServicegetChildren in interface SearchServicenodeId - The ID of the recordoffset - The offset of the first childlimit - The number of records to retrievepublic boolean isHierarchy(String nodeId)
isHierarchy in interface SearchServicepublic List<Neo4jBean> getChildren(String nodeId, int offset)
SearchServicegetChildren in interface SearchServicenodeId - The ID of the recordoffset - The offset of the first childpublic List<Neo4jBean> getChildren(String nodeId)
SearchServicegetChildren in interface SearchServicenodeId - The ID of the recordpublic Neo4jBean getHierarchicalBean(String nodeId)
SearchServicegetHierarchicalBean in interface SearchServicenodeId - The ID of the recordpublic Date getLastSolrUpdate() throws org.apache.solr.client.solrj.SolrServerException, IOException
SearchServicegetLastSolrUpdate in interface SearchServiceorg.apache.solr.client.solrj.SolrServerExceptionIOExceptionpublic void logTime(String type, long time)
public List<Neo4jBean> getPreceedingSiblings(String nodeId, int limit)
SearchServicegetPreceedingSiblings in interface SearchServicenodeId - The ID of the recordlimit - How many siblings to retrievepublic List<Neo4jBean> getPreceedingSiblings(String nodeId)
SearchServicegetPreceedingSiblings in interface SearchServicenodeId - The ID of the recordpublic List<Neo4jBean> getFollowingSiblings(String nodeId, int limit)
SearchServicegetFollowingSiblings in interface SearchServicenodeId - The ID of the recordlimit - How many siblings to retrievepublic List<Neo4jBean> getFollowingSiblings(String nodeId)
SearchServicegetFollowingSiblings in interface SearchServicepublic long getChildrenCount(String nodeId)
SearchServicegetChildrenCount in interface SearchServicepublic Neo4jStructBean getInitialStruct(String nodeId)
SearchServicegetInitialStruct in interface SearchServicenodeId - The ID of the recordCopyright © 2015 Europeana Foundation. All rights reserved.