public class QueryServiceImpl extends Object implements QueryService
| Modifier and Type | Method and Description |
|---|---|
List<WorkBibDocument> |
browseCallNumbers(CallNumberBrowseParams callNumberBrowseParams)
Used to display closest record based on input fields classification, rows and start index
|
WorkBibDocument |
buildBibDocumentInfo(WorkBibDocument bibDocument) |
String |
buildCommonQueryForForwardCallNumber(String location,
String classificationScheme,
String callNumberBrowseText,
String docType) |
void |
buildItemCallNumber(List<WorkItemDocument> itemDocuments)
Append 'Enumeration', 'Chronology' and 'Copy Number' to item call number based on their availability.
|
List<OleDocument> |
buildOleDocuments(List<Map<String,Object>> hitsOnPage) |
List<OLESerialReceivingRecord> |
buildOleSerialReceivingRecords(List<Map<String,Object>> hitsOnPage) |
String |
buildQuery(SearchParams searchParams) |
String |
buildQueryForBib(List<WorkItemDocument> workItemDocumentList)
Building solr query with list of Item records
The solr query is used to get Bib records.
|
String |
buildQueryForBrowseCallNumbers(String location,
String classificationScheme,
int numRows,
int startIndex,
String docType)
Building solr query for getting Item/Holdings records with call number
|
String |
buildQueryForDoc(OleDocument queryDoc) |
String |
buildQueryForTotalCallNumberCount(String location,
String classificationScheme,
String docType)
Preparing solr query based on user input fields location and classification scheme.
|
String |
buildQueryForTotalForwardCallNumberCount(String location,
String classificationScheme,
String callNumberBrowseText,
String docType) |
String |
buildQueryWithFieldListParameters(List<String> fieldsList) |
String |
buildQueryWithSearchParameters(List<SearchCondition> searchFieldsList) |
String |
buildQueryWithSortFields(String sortField,
String sortOrder) |
List<WorkBibDocument> |
buildWorkBibDocuments(List<Map<String,Object>> hitsOnPage) |
List<WorkHoldingsDocument> |
buildWorkHoldingDocuments(List<Map<String,Object>> hitsOnPage) |
List<WorkItemDocument> |
buildWorkItemDocuments(List<Map<String,Object>> hitsOnPage) |
List<String> |
getBibDetailsForPurchaseOrderSearch(Map<String,String> searchCriteria) |
List<WorkBibDocument> |
getBibDocuments(SearchParams searchParams) |
Map<String,String> |
getBibInformation(String bibIdentifier,
Map<String,String> searchCriteria) |
List<String> |
getBibUuidsForBibMatchPoints(String code,
String value) |
List |
getDocuments(SearchParams searchParams)
Get List of records from solr after click next or previous
|
List<WorkEHoldingsDocument> |
getEHoldingsDocuments(SearchParams searchParams) |
String |
getFieldValue(org.apache.solr.client.solrj.response.QueryResponse response,
String fieldName) |
List<WorkHoldingsDocument> |
getHoldingDocuments(SearchParams searchParams) |
static QueryService |
getInstance() |
Map |
getItemDetails(String itemBarcode,
String itemUUID)
Retrieve instance,item and bib uuid using item barcode or item uuid.
|
List<WorkItemDocument> |
getItemDocuments(SearchParams searchParams) |
List<String> |
getItemIdsForInstanceIds(List<String> instanceIds) |
List<OLESerialReceivingRecord> |
getOleSerialReceivingRecords(SearchParams searchParams) |
int |
getSolrHitsForCallNumberBrowse(String inputQuery) |
List<Map<String,Object>> |
getSolrHitsForCallNumberBrowse(String inputQuery,
int start,
int numRows) |
List<Map<String,Object>> |
getSolrHitsForQuery(String inputQuery) |
List<Map<String,Object>> |
getSolrHitsForQueryParams(SearchParams searchParams)
Gets Solr response for search Params
|
int |
getSolrHitsForQueryParams(String inputQuery)
Gets total number of records from solr
|
Map |
getTitleAndAuthorfromBib(String bibUuid)
Retrieve title and author from docstore using solr query.
|
List<String> |
getTitleValues(String fieldValue)
This method returns the list of titles based on the given search value.
|
List<String> |
getUUIDList(List<String> idList,
String identifierType) |
List<WorkBibDocument> |
getWorkBibDocuments(List<WorkItemDocument> workItemDocuments)
Prepares a list of Bib records based on available Item records.
|
List<WorkBibDocument> |
getWorkBibRecords(List<LinkedHashMap<String,String>> uuidsMapList) |
protected void |
init() |
void |
initCallNumberBrowse(CallNumberBrowseParams callNumberBrowseParams)
Prepares the solr query based on user input values location, classification and call number browse text
Calculates totalCallNumberCount and totalForwardCallNumberCount based on solr query results
Evaluates matchIndex based on totalCallNumberCount and totalForwardCallNumberCount
|
boolean |
isFieldValueExists(String docType,
String field,
String value,
String id)
Verify solr for the field and return true if exists (Ingest)
Verify solr for the field other updating record (Update)
|
List<WorkBibDocument> |
mergeBibAndItemDocuments(List<WorkItemDocument> workItemDocumentList,
List<WorkBibDocument> workBibDocumentList)
Merges the item documents with corresponding Bib document.
|
String |
queryField(SearchParams searchParams,
String fieldName) |
String |
queryForBib(String itemId) |
List<String> |
queryForBibs(String instancedId)
This method returns the Bib ids for the selected bound-with instance.
|
List<WorkBibDocument> |
queryForBibTree(List<WorkBibDocument> workBibDocumentList) |
WorkBibDocument |
queryForBibTree(WorkBibDocument queryDoc) |
List<OleDocument> |
queryForDocs(OleDocument queryDoc) |
WorkEInstanceDocument |
queryForEInstanceTree(WorkEInstanceDocument eInstanceDocument) |
List<String> |
queryForInstances(String uuid)
This method used to get the instances for the selected bibs.
|
WorkInstanceDocument |
queryForInstanceTree(WorkInstanceDocument instanceDocument) |
List<String> |
queryForItems(String bibId) |
WorkItemDocument |
queryForItemTree(WorkItemDocument itemDocument) |
List |
retriveResults(String queryString) |
List |
retriveResults(String queryString,
int rowSize)
This method is for item search in deliver
|
boolean |
verifyFieldValue(String uuid,
String fieldName,
List<String> fieldValueList)
Verifies whether the given field for the given document id has a value from the given value list.
|
public static QueryService getInstance()
protected void init()
public List<OleDocument> queryForDocs(OleDocument queryDoc) throws Exception
queryForDocs in interface QueryServiceExceptionpublic List<WorkBibDocument> getBibDocuments(SearchParams searchParams) throws Exception
getBibDocuments in interface QueryServiceExceptionpublic List<WorkHoldingsDocument> getHoldingDocuments(SearchParams searchParams) throws Exception
getHoldingDocuments in interface QueryServiceExceptionpublic List<OLESerialReceivingRecord> getOleSerialReceivingRecords(SearchParams searchParams) throws Exception
getOleSerialReceivingRecords in interface QueryServiceExceptionpublic List<WorkItemDocument> getItemDocuments(SearchParams searchParams) throws Exception
getItemDocuments in interface QueryServiceExceptionpublic List getDocuments(SearchParams searchParams)
getDocuments in interface QueryServicesearchParams - Exceptionpublic String queryField(SearchParams searchParams, String fieldName) throws Exception
queryField in interface QueryServiceExceptionpublic String getFieldValue(org.apache.solr.client.solrj.response.QueryResponse response, String fieldName)
public List<OLESerialReceivingRecord> buildOleSerialReceivingRecords(List<Map<String,Object>> hitsOnPage) throws org.apache.solr.client.solrj.SolrServerException
hitsOnPage - org.apache.solr.client.solrj.SolrServerExceptionpublic List<OleDocument> buildOleDocuments(List<Map<String,Object>> hitsOnPage)
hitsOnPage - public List<WorkBibDocument> buildWorkBibDocuments(List<Map<String,Object>> hitsOnPage)
hitsOnPage - public List<WorkHoldingsDocument> buildWorkHoldingDocuments(List<Map<String,Object>> hitsOnPage)
hitsOnPage - public List<WorkItemDocument> buildWorkItemDocuments(List<Map<String,Object>> hitsOnPage)
hitsOnPage - public WorkBibDocument queryForBibTree(WorkBibDocument queryDoc) throws Exception
queryForBibTree in interface QueryServicequeryDoc - Exceptionpublic WorkBibDocument buildBibDocumentInfo(WorkBibDocument bibDocument) throws org.apache.solr.client.solrj.SolrServerException, IOException
buildBibDocumentInfo in interface QueryServiceorg.apache.solr.client.solrj.SolrServerExceptionIOExceptionpublic List<WorkBibDocument> queryForBibTree(List<WorkBibDocument> workBibDocumentList) throws Exception
queryForBibTree in interface QueryServiceworkBibDocumentList - Exceptionpublic List<String> queryForBibs(String instancedId) throws org.apache.solr.client.solrj.SolrServerException
queryForBibs in interface QueryServiceinstancedId - org.apache.solr.client.solrj.SolrServerExceptionpublic List<String> queryForItems(String bibId) throws org.apache.solr.client.solrj.SolrServerException
queryForItems in interface QueryServiceorg.apache.solr.client.solrj.SolrServerExceptionpublic String queryForBib(String itemId) throws org.apache.solr.client.solrj.SolrServerException
queryForBib in interface QueryServiceorg.apache.solr.client.solrj.SolrServerExceptionpublic List<String> queryForInstances(String uuid) throws org.apache.solr.client.solrj.SolrServerException
queryForInstances in interface QueryServiceuuid - org.apache.solr.client.solrj.SolrServerExceptionpublic WorkInstanceDocument queryForInstanceTree(WorkInstanceDocument instanceDocument) throws org.apache.solr.client.solrj.SolrServerException
queryForInstanceTree in interface QueryServiceorg.apache.solr.client.solrj.SolrServerExceptionpublic WorkItemDocument queryForItemTree(WorkItemDocument itemDocument) throws org.apache.solr.client.solrj.SolrServerException
queryForItemTree in interface QueryServiceorg.apache.solr.client.solrj.SolrServerExceptionpublic WorkEInstanceDocument queryForEInstanceTree(WorkEInstanceDocument eInstanceDocument) throws org.apache.solr.client.solrj.SolrServerException
queryForEInstanceTree in interface QueryServiceorg.apache.solr.client.solrj.SolrServerExceptionpublic String buildQueryForDoc(OleDocument queryDoc)
buildQueryForDoc in interface QueryServicequeryDoc - public List<Map<String,Object>> getSolrHitsForQuery(String inputQuery) throws Exception
inputQuery - Exception - Usage: Gets Solr response for input query and builds List of Maps holding Solr Doc Datapublic List<Map<String,Object>> getSolrHitsForQueryParams(SearchParams searchParams) throws Exception
searchParams - Exceptionpublic int getSolrHitsForQueryParams(String inputQuery) throws Exception
inputQuery - Exceptionpublic List<String> getUUIDList(List<String> idList, String identifierType)
getUUIDList in interface QueryServiceidList - identifierType - public List<String> getTitleValues(String fieldValue)
getTitleValues in interface QueryServicefieldValue - public String buildQuery(SearchParams searchParams)
buildQuery in interface QueryServicepublic String buildQueryWithSearchParameters(List<SearchCondition> searchFieldsList)
public String buildQueryWithSortFields(String sortField, String sortOrder)
public String buildQueryWithFieldListParameters(List<String> fieldsList)
public void initCallNumberBrowse(CallNumberBrowseParams callNumberBrowseParams) throws Exception
initCallNumberBrowse in interface QueryServicecallNumberBrowseParams - contains required parameters for call number browse functionalityExceptionpublic List<WorkBibDocument> browseCallNumbers(CallNumberBrowseParams callNumberBrowseParams) throws Exception
browseCallNumbers in interface QueryServicecallNumberBrowseParams - contains required parameters for call number browse functionalityExceptionpublic List<WorkBibDocument> mergeBibAndItemDocuments(List<WorkItemDocument> workItemDocumentList, List<WorkBibDocument> workBibDocumentList)
workItemDocumentList - contains list of Item recordsworkBibDocumentList - contains list of Bib records.public List<WorkBibDocument> getWorkBibDocuments(List<WorkItemDocument> workItemDocuments) throws Exception
workItemDocuments - contains list of Item documentsExceptionpublic String buildQueryForBib(List<WorkItemDocument> workItemDocumentList)
workItemDocumentList - contains list of Item recordspublic String buildQueryForTotalCallNumberCount(String location, String classificationScheme, String docType)
location - contains user input locationclassificationScheme - user input classificationpublic String buildQueryForBrowseCallNumbers(String location, String classificationScheme, int numRows, int startIndex, String docType)
location - the Item/Holdings locationclassificationScheme - the Item/Holdings classificationnumRows - the number of rows for displaying resultsstartIndex - index used to specify thepublic String buildQueryForTotalForwardCallNumberCount(String location, String classificationScheme, String callNumberBrowseText, String docType)
location - the Item/Holdings location.classificationScheme - the Item/Holdings classification.callNumberBrowseText - the user input field callNumberBrowseText.public String buildCommonQueryForForwardCallNumber(String location, String classificationScheme, String callNumberBrowseText, String docType)
location - the Item/Holdings locationclassificationScheme - the Item/Holdings classificationcallNumberBrowseText - the user input field callNumberBrowseText.public List<WorkBibDocument> getWorkBibRecords(List<LinkedHashMap<String,String>> uuidsMapList) throws Exception
getWorkBibRecords in interface QueryServiceExceptionpublic List<Map<String,Object>> getSolrHitsForCallNumberBrowse(String inputQuery, int start, int numRows) throws Exception
inputQuery - input querystart - start indexnumRows - the number of rows for displaying resultsExceptionpublic int getSolrHitsForCallNumberBrowse(String inputQuery) throws Exception
Exceptionpublic boolean isFieldValueExists(String docType, String field, String value, String id) throws Exception
isFieldValueExists in interface QueryServicedocType - field - value - id - Exceptionpublic void buildItemCallNumber(List<WorkItemDocument> itemDocuments)
itemDocuments - public List retriveResults(String queryString)
retriveResults in interface QueryServicepublic Map getItemDetails(String itemBarcode, String itemUUID) throws Exception
getItemDetails in interface QueryServiceitemBarcode - Exceptionpublic Map getTitleAndAuthorfromBib(String bibUuid) throws Exception
getTitleAndAuthorfromBib in interface QueryServicebibUuid - Exceptionpublic Map<String,String> getBibInformation(String bibIdentifier, Map<String,String> searchCriteria)
getBibInformation in interface QueryServicepublic List retriveResults(String queryString, int rowSize)
retriveResults in interface QueryServicequeryString - rowSize - public boolean verifyFieldValue(String uuid, String fieldName, List<String> fieldValueList) throws org.apache.solr.client.solrj.SolrServerException
verifyFieldValue in interface QueryServiceuuid - fieldName - fieldValueList - - "," separated valuesorg.apache.solr.client.solrj.SolrServerExceptionpublic List<String> getItemIdsForInstanceIds(List<String> instanceIds) throws org.apache.solr.client.solrj.SolrServerException
getItemIdsForInstanceIds in interface QueryServiceinstanceIds - org.apache.solr.client.solrj.SolrServerExceptionpublic List<WorkEHoldingsDocument> getEHoldingsDocuments(SearchParams searchParams) throws Exception
getEHoldingsDocuments in interface QueryServiceExceptionpublic List<String> getBibUuidsForBibMatchPoints(String code, String value) throws org.apache.solr.client.solrj.SolrServerException
getBibUuidsForBibMatchPoints in interface QueryServiceorg.apache.solr.client.solrj.SolrServerExceptionpublic List<String> getBibDetailsForPurchaseOrderSearch(Map<String,String> searchCriteria)
getBibDetailsForPurchaseOrderSearch in interface QueryServiceCopyright © 2004–2015 The Kuali Foundation. All rights reserved.