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 QueryService
Exception
public List<WorkBibDocument> getBibDocuments(SearchParams searchParams) throws Exception
getBibDocuments
in interface QueryService
Exception
public List<WorkHoldingsDocument> getHoldingDocuments(SearchParams searchParams) throws Exception
getHoldingDocuments
in interface QueryService
Exception
public List<OLESerialReceivingRecord> getOleSerialReceivingRecords(SearchParams searchParams) throws Exception
getOleSerialReceivingRecords
in interface QueryService
Exception
public List<WorkItemDocument> getItemDocuments(SearchParams searchParams) throws Exception
getItemDocuments
in interface QueryService
Exception
public List getDocuments(SearchParams searchParams)
getDocuments
in interface QueryService
searchParams
- Exception
public String queryField(SearchParams searchParams, String fieldName) throws Exception
queryField
in interface QueryService
Exception
public 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.SolrServerException
public 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 QueryService
queryDoc
- Exception
public WorkBibDocument buildBibDocumentInfo(WorkBibDocument bibDocument) throws org.apache.solr.client.solrj.SolrServerException, IOException
buildBibDocumentInfo
in interface QueryService
org.apache.solr.client.solrj.SolrServerException
IOException
public List<WorkBibDocument> queryForBibTree(List<WorkBibDocument> workBibDocumentList) throws Exception
queryForBibTree
in interface QueryService
workBibDocumentList
- Exception
public List<String> queryForBibs(String instancedId) throws org.apache.solr.client.solrj.SolrServerException
queryForBibs
in interface QueryService
instancedId
- org.apache.solr.client.solrj.SolrServerException
public List<String> queryForItems(String bibId) throws org.apache.solr.client.solrj.SolrServerException
queryForItems
in interface QueryService
org.apache.solr.client.solrj.SolrServerException
public String queryForBib(String itemId) throws org.apache.solr.client.solrj.SolrServerException
queryForBib
in interface QueryService
org.apache.solr.client.solrj.SolrServerException
public List<String> queryForInstances(String uuid) throws org.apache.solr.client.solrj.SolrServerException
queryForInstances
in interface QueryService
uuid
- org.apache.solr.client.solrj.SolrServerException
public WorkInstanceDocument queryForInstanceTree(WorkInstanceDocument instanceDocument) throws org.apache.solr.client.solrj.SolrServerException
queryForInstanceTree
in interface QueryService
org.apache.solr.client.solrj.SolrServerException
public WorkItemDocument queryForItemTree(WorkItemDocument itemDocument) throws org.apache.solr.client.solrj.SolrServerException
queryForItemTree
in interface QueryService
org.apache.solr.client.solrj.SolrServerException
public WorkEInstanceDocument queryForEInstanceTree(WorkEInstanceDocument eInstanceDocument) throws org.apache.solr.client.solrj.SolrServerException
queryForEInstanceTree
in interface QueryService
org.apache.solr.client.solrj.SolrServerException
public String buildQueryForDoc(OleDocument queryDoc)
buildQueryForDoc
in interface QueryService
queryDoc
- 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
- Exception
public int getSolrHitsForQueryParams(String inputQuery) throws Exception
inputQuery
- Exception
public List<String> getUUIDList(List<String> idList, String identifierType)
getUUIDList
in interface QueryService
idList
- identifierType
- public List<String> getTitleValues(String fieldValue)
getTitleValues
in interface QueryService
fieldValue
- public String buildQuery(SearchParams searchParams)
buildQuery
in interface QueryService
public 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 QueryService
callNumberBrowseParams
- contains required parameters for call number browse functionalityException
public List<WorkBibDocument> browseCallNumbers(CallNumberBrowseParams callNumberBrowseParams) throws Exception
browseCallNumbers
in interface QueryService
callNumberBrowseParams
- contains required parameters for call number browse functionalityException
public 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 documentsException
public 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 QueryService
Exception
public List<Map<String,Object>> getSolrHitsForCallNumberBrowse(String inputQuery, int start, int numRows) throws Exception
inputQuery
- input querystart
- start indexnumRows
- the number of rows for displaying resultsException
public int getSolrHitsForCallNumberBrowse(String inputQuery) throws Exception
Exception
public boolean isFieldValueExists(String docType, String field, String value, String id) throws Exception
isFieldValueExists
in interface QueryService
docType
- field
- value
- id
- Exception
public void buildItemCallNumber(List<WorkItemDocument> itemDocuments)
itemDocuments
- public List retriveResults(String queryString)
retriveResults
in interface QueryService
public Map getItemDetails(String itemBarcode, String itemUUID) throws Exception
getItemDetails
in interface QueryService
itemBarcode
- Exception
public Map getTitleAndAuthorfromBib(String bibUuid) throws Exception
getTitleAndAuthorfromBib
in interface QueryService
bibUuid
- Exception
public Map<String,String> getBibInformation(String bibIdentifier, Map<String,String> searchCriteria)
getBibInformation
in interface QueryService
public List retriveResults(String queryString, int rowSize)
retriveResults
in interface QueryService
queryString
- rowSize
- public boolean verifyFieldValue(String uuid, String fieldName, List<String> fieldValueList) throws org.apache.solr.client.solrj.SolrServerException
verifyFieldValue
in interface QueryService
uuid
- fieldName
- fieldValueList
- - "," separated valuesorg.apache.solr.client.solrj.SolrServerException
public List<String> getItemIdsForInstanceIds(List<String> instanceIds) throws org.apache.solr.client.solrj.SolrServerException
getItemIdsForInstanceIds
in interface QueryService
instanceIds
- org.apache.solr.client.solrj.SolrServerException
public List<WorkEHoldingsDocument> getEHoldingsDocuments(SearchParams searchParams) throws Exception
getEHoldingsDocuments
in interface QueryService
Exception
public List<String> getBibUuidsForBibMatchPoints(String code, String value) throws org.apache.solr.client.solrj.SolrServerException
getBibUuidsForBibMatchPoints
in interface QueryService
org.apache.solr.client.solrj.SolrServerException
public List<String> getBibDetailsForPurchaseOrderSearch(Map<String,String> searchCriteria)
getBibDetailsForPurchaseOrderSearch
in interface QueryService
Copyright © 2004–2015 The Kuali Foundation. All rights reserved.