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 |
metainfoMongoServer |
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 rdfAbout)
Get the children of the node (max 10)
|
List<Neo4jBean> |
getChildren(String rdfAbout,
int offset)
Get the children of the node (max 10)
|
List<Neo4jBean> |
getChildren(String rdfAbout,
int offset,
int limit)
Get the children of the node (max 10)
|
long |
getChildrenCount(String rdfAbout)
Get the number of children this node has
|
List<Neo4jBean> |
getFollowingSiblings(String rdfAbout)
Get the node's 10 following siblings
|
List<Neo4jBean> |
getFollowingSiblings(String rdfAbout,
int limit)
Get the nodes following siblings
|
Neo4jBean |
getHierarchicalBean(String rdfAbout)
Get a node object
|
Neo4jStructBean |
getInitialStruct(String nodeId)
Get the initial structure, which contains self, the ancestors,
preceding and following siblings
|
Date |
getLastSolrUpdate() |
List<Neo4jBean> |
getPrecedingSiblings(String rdfAbout)
Get the nodes preceding siblings (max 10)
|
List<Neo4jBean> |
getPrecedingSiblings(String rdfAbout,
int limit)
Get the nodes preceeding siblings
|
boolean |
isHierarchy(String rdfAbout) |
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)
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.
|
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 calculateTag 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
protected EdmMongoServer metainfoMongoServer
public FullBean findById(String collectionId, String recordId, boolean similarItems) throws MongoRuntimeException, MongoDBException, Neo4JException
SearchServicefindById in interface SearchServicecollectionId - id of the collection to which this record belongssimilarItems - whether to retrieve similar itemsMongoRuntimeExceptionMongoDBExceptionNeo4JExceptionpublic FullBean findById(String europeanaObjectId, boolean similarItems) throws MongoRuntimeException, MongoDBException
SearchServicefindById in interface SearchServiceeuropeanaObjectId - The unique europeana idsimilarItems - Whether to retrieve similar itemsMongoRuntimeExceptionMongoDBExceptionpublic 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 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) 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)public 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 calculateTag specification.SolrTypeExceptionpublic 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 SolrTypeException
SearchServicecreateCollections in interface SearchServicefacetFieldName - The SolrFacetType 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 SearchServicequeries - Map of field names, and corresponding field values.public 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 calculateTag term to find suggestions forpageSize - Amount of requested suggestionspublic void setSolrServer(org.apache.solr.client.solrj.SolrServer solrServer)
public List<Neo4jBean> getChildren(String rdfAbout, int offset, int limit)
SearchServicegetChildren in interface SearchServicerdfAbout - The ID of the recordoffset - The offset of the first childlimit - The number of records to retrievepublic boolean isHierarchy(String rdfAbout) throws Neo4JException
isHierarchy in interface SearchServiceNeo4JExceptionpublic List<Neo4jBean> getChildren(String rdfAbout, int offset)
SearchServicegetChildren in interface SearchServicerdfAbout - The ID of the recordoffset - The offset of the first childpublic List<Neo4jBean> getChildren(String rdfAbout)
SearchServicegetChildren in interface SearchServicerdfAbout - The ID of the recordpublic Neo4jBean getHierarchicalBean(String rdfAbout) throws Neo4JException
SearchServicegetHierarchicalBean in interface SearchServicerdfAbout - The ID of the recordNeo4JExceptionpublic Date getLastSolrUpdate() throws org.apache.solr.client.solrj.SolrServerException, IOException
getLastSolrUpdate in interface SearchServiceorg.apache.solr.client.solrj.SolrServerExceptionIOExceptionpublic void logTime(String type, long time)
public List<Neo4jBean> getPrecedingSiblings(String rdfAbout, int limit) throws Neo4JException
SearchServicegetPrecedingSiblings in interface SearchServicerdfAbout - The ID of the recordlimit - How many siblings to retrieveNeo4JExceptionpublic List<Neo4jBean> getPrecedingSiblings(String rdfAbout) throws Neo4JException
SearchServicegetPrecedingSiblings in interface SearchServicerdfAbout - The ID of the recordNeo4JExceptionpublic List<Neo4jBean> getFollowingSiblings(String rdfAbout, int limit) throws Neo4JException
SearchServicegetFollowingSiblings in interface SearchServicerdfAbout - The ID of the recordlimit - How many siblings to retrieveNeo4JExceptionpublic List<Neo4jBean> getFollowingSiblings(String rdfAbout) throws Neo4JException
SearchServicegetFollowingSiblings in interface SearchServicerdfAbout - The ID of the recordNeo4JExceptionpublic long getChildrenCount(String rdfAbout) throws Neo4JException
SearchServicegetChildrenCount in interface SearchServiceNeo4JExceptionpublic Neo4jStructBean getInitialStruct(String nodeId) throws Neo4JException
SearchServicegetInitialStruct in interface SearchServicenodeId - The ID of the recordNeo4JExceptionCopyright © 2017 Europeana Foundation. All rights reserved.