Package ca.uhn.fhir.jpa.dao
Interface IFulltextSearchSvc
- All Known Implementing Classes:
FulltextSearchSvcImpl
public interface IFulltextSearchSvc
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canUseHibernateSearch
(String theResourceType, SearchParameterMap theParameterMap) Returns true if the parameter map can be handled for hibernate search.long
count
(String theResourceName, SearchParameterMap theParams) Returns accurate hit countvoid
deleteIndexedDocumentsByTypeAndId
(Class theClazz, List<Object> theGivenIds) Given a resource type that is indexed by hibernate search, and a list of objects reprenting the IDs you wish to delete, this method will delete the resources from the Hibernate Search index.<T extends ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId>
List<T> everything
(String theResourceName, SearchParameterMap theParams, T theReferencingPid, ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) extractLuceneIndexData
(org.hl7.fhir.instance.model.api.IBaseResource theResource, ResourceTable theEntity, ResourceIndexedSearchParams theNewParams) List
<org.hl7.fhir.instance.model.api.IBaseResource> getResources
(Collection<Long> thePids) Returns inlined resource stored along with index mappings for matched identifiersboolean
List
<ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId> lastN
(SearchParameterMap theParams, Integer theMaximumResults) void
reindex
(ResourceTable theEntity) Re-publish the resource to the full-text index.<T extends ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId>
List<T> search
(String theResourceName, SearchParameterMap theParams, ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) Search the Lucene/Elastic index for pids using params supported in theParams, consuming entries from theParams when used to query.List
<org.hl7.fhir.instance.model.api.IBaseResource> searchForResources
(String theResourceType, SearchParameterMap theParams, ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) searchNotScrolled
(String theResourceName, SearchParameterMap theParams, Integer theMaxResultsToFetch, ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) Query the index for a plain list (non-scrollable) iterator of results.searchScrolled
(String theResourceName, SearchParameterMap theParams, ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) Query the index for a complete iterator of ALL results.boolean
supportsAllOf
(SearchParameterMap theParams) boolean
supportsAllSortTerms
(String theResourceName, SearchParameterMap theParams) Given a resource type and aSearchParameterMap
, return true only if all sort terms are supported.org.hl7.fhir.instance.model.api.IBaseResource
Autocomplete search for NIH $expand contextDirection=existing
-
Method Details
-
search
<T extends ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId> List<T> search(String theResourceName, SearchParameterMap theParams, ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) Search the Lucene/Elastic index for pids using params supported in theParams, consuming entries from theParams when used to query.- Parameters:
theResourceName
- the resource name to restrict the query.theParams
- the full query - modified to return only params unused by the index.theRequestDetails
- The request details- Returns:
- the pid list for the matchign resources.
-
searchNotScrolled
ISearchQueryExecutor searchNotScrolled(String theResourceName, SearchParameterMap theParams, Integer theMaxResultsToFetch, ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) Query the index for a plain list (non-scrollable) iterator of results.- Parameters:
theResourceName
- e.g. PatienttheParams
- The search querytheMaxResultsToFetch
- maximum results to fetchtheRequestDetails
- The request details- Returns:
- Iterator of result PIDs
-
searchScrolled
ISearchQueryExecutor searchScrolled(String theResourceName, SearchParameterMap theParams, ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) Query the index for a complete iterator of ALL results. (scrollable search result).- Parameters:
theResourceName
- e.g. PatienttheParams
- The search querytheRequestDetails
- The request details- Returns:
- Iterator of result PIDs
-
tokenAutocompleteValueSetSearch
org.hl7.fhir.instance.model.api.IBaseResource tokenAutocompleteValueSetSearch(ValueSetAutocompleteOptions theOptions) Autocomplete search for NIH $expand contextDirection=existing- Parameters:
theOptions
- operation options- Returns:
- a ValueSet with the search hits as the expansion.
-
everything
<T extends ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId> List<T> everything(String theResourceName, SearchParameterMap theParams, T theReferencingPid, ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) -
isDisabled
boolean isDisabled() -
extractLuceneIndexData
ExtendedHSearchIndexData extractLuceneIndexData(org.hl7.fhir.instance.model.api.IBaseResource theResource, ResourceTable theEntity, ResourceIndexedSearchParams theNewParams) -
canUseHibernateSearch
Returns true if the parameter map can be handled for hibernate search. We have to filter out any queries that might use search params we only know how to handle in JPA. - SeeExtendedHSearchSearchBuilder.addAndConsumeAdvancedQueryClauses(ca.uhn.fhir.jpa.dao.search.ExtendedHSearchClauseBuilder, ca.uhn.fhir.jpa.model.search.ExtendedHSearchBuilderConsumeAdvancedQueryClausesParams)
-
reindex
Re-publish the resource to the full-text index. - During update, hibernate search only republishes the entity if it has changed. During $reindex, we want to force the re-index.- Parameters:
theEntity
- the fully populated ResourceTable entity
-
lastN
List<ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId> lastN(SearchParameterMap theParams, Integer theMaximumResults) -
getResources
Returns inlined resource stored along with index mappings for matched identifiers- Parameters:
thePids
- raw pids - we dont support versioned references- Returns:
- Resources list or empty if nothing found
-
count
Returns accurate hit count -
searchForResources
List<org.hl7.fhir.instance.model.api.IBaseResource> searchForResources(String theResourceType, SearchParameterMap theParams, ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) -
supportsAllOf
-
deleteIndexedDocumentsByTypeAndId
Given a resource type that is indexed by hibernate search, and a list of objects reprenting the IDs you wish to delete, this method will delete the resources from the Hibernate Search index. This is useful for situations where a deletion occurred outside a Hibernate ORM session, leaving dangling documents in the index.- Parameters:
theClazz
- The class, which must be annotated withIndexed
theGivenIds
- The list of IDs for the given document type. Note that while this is a List
-
supportsAllSortTerms
Given a resource type and aSearchParameterMap
, return true only if all sort terms are supported.- Parameters:
theResourceName
- The resource type for the query.theParams
- TheSearchParameterMap
being searched with.- Returns:
- true if all sort terms are supported, false otherwise.
-