| Modifier and Type | Field and Description |
|---|---|
protected AuthService |
authService |
protected String |
authServiceFields
Comma separated list of solr fields that need to have the authService substitute values if they are used in a facet.
|
static String |
biocacheMediaDir |
static String |
biocacheMediaUrl |
protected static char[] |
CHARS |
static String |
COMMON_NAME_AND_LSID |
protected static String |
DECADE_FACET_NAME |
protected Integer |
downloadBatchSize
Batch size for a download
|
protected DownloadFields |
downloadFields
Download properties
|
protected static Integer |
FACET_PAGE_SIZE |
protected Pattern |
indexFieldPatternMatcher |
protected Pattern |
layersPattern |
protected LayersService |
layersService |
protected Pattern |
lsidPattern |
protected Integer |
MAX_DOWNLOAD_SIZE
Limit search results - for performance reasons
|
protected Integer |
maxMultiPartThreads
Max number of threads to use in endemic queries
|
static String |
NAMES_AND_LSID |
protected Pattern |
qidPattern |
protected org.apache.solr.client.solrj.SolrRequest.METHOD |
queryMethod |
protected static String |
QUOTE |
protected static String |
RANGE_SUFFIX |
protected SearchUtils |
searchUtils |
protected org.apache.solr.client.solrj.SolrServer |
server
SOLR server instance
|
protected Pattern |
spacesPattern |
protected Pattern |
spatialPattern |
protected Pattern |
termPattern |
protected Integer |
termQueryLimit |
protected Pattern |
uidPattern |
protected Pattern |
urnPattern |
protected Boolean |
usingLocalMediaRepo
Max number of threads to use in endemic queries
|
| Constructor and Description |
|---|
SearchDAOImpl()
Initialise the SOLR server instance
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
buildSpatialQueryString(SpatialSearchRequestParams searchParams) |
protected String |
buildSpatialQueryString(String fullTextQuery,
Float latitude,
Float longitude,
Float radius)
Build the query string for a spatial query (using Spatial-Solr plugin syntax)
TODO change param type to SearchRequestParams
New plugin syntax
{!spatial circles=52.347,4.453,10}
TODO different types of spatial queries...
|
TaxaRankCountDTO |
calculateBreakdown(BreakdownRequestParams queryParams)
Calculates the breakdown of the supplied query based on the supplied params
|
List<TaxaCountDTO> |
findAllSpecies(SpatialSearchRequestParams requestParams)
Find all species (and counts) for a given query.
|
List<TaxaCountDTO> |
findAllSpeciesByCircleAreaAndHigherTaxa(SpatialSearchRequestParams requestParams,
String speciesGroup)
Find all species (and counts) for a given location search (lat/long and radius) and a higher taxon (with rank)
|
org.apache.solr.common.SolrDocumentList |
findByFulltext(SpatialSearchRequestParams searchParams)
Find all occurrences for a given query as SolrDocumentList
|
SearchResultDTO |
findByFulltextSpatialQuery(SpatialSearchRequestParams searchParams,
boolean includeSensitive,
Map<String,String[]> extraParams)
Find all occurrences for a given (full text) query, latitude, longitude & radius (km).
|
SearchResultDTO |
findByFulltextSpatialQuery(SpatialSearchRequestParams searchParams,
Map<String,String[]> extraParams)
Find all occurrences for a given (full text) query, latitude, longitude & radius (km).
|
List<FieldResultDTO> |
findRecordByStateFor(String query) |
List<OccurrencePoint> |
findRecordsForLocation(SpatialSearchRequestParams requestParams,
PointType pointType)
Get a list of occurrence points for a given lat/long and distance (radius)
|
TaxaRankCountDTO |
findTaxonCountForUid(BreakdownRequestParams breakdownParams,
String query)
Deprecated.
use
calculateBreakdown(BreakdownRequestParams) instead |
String |
formatDisplayStringWithI18n(String displayText)
Substitute with i18n properties
|
protected void |
formatSearchQuery(SpatialSearchRequestParams searchParams) |
protected void |
formatSearchQuery(SpatialSearchRequestParams searchParams,
boolean forceQueryFormat)
Format the search input query for a full-text search.
|
Set<String> |
getAuthIndexFields() |
List<DataProviderCountDTO> |
getDataProviderCounts()
http://ala-biocache1.vm.csiro.au:8080/solr/select?q=*:*&rows=0&facet=true&facet.field=data_provider_id&facet.field=data_provider&facet.sort=data_provider_id
|
List<DataProviderCountDTO> |
getDataProviderList(SpatialSearchRequestParams requestParams)
Get a data provider list for a query.
|
List<FieldResultDTO> |
getEndemicSpecies(SpatialSearchRequestParams requestParams)
Returns a list of species that are endemic to the supplied region.
|
org.apache.solr.client.solrj.response.FacetField |
getFacet(SpatialSearchRequestParams searchParams,
String facet) |
List<FacetResultDTO> |
getFacetCounts(SpatialSearchRequestParams searchParams)
Returns the count of distinct values for the facets.
|
List<OccurrencePoint> |
getFacetPoints(SpatialSearchRequestParams searchParams,
PointType pointType)
Retrieve an OccurrencePoint (distinct list of points - lat-long to 4 decimal places) for a given search
|
Set<IndexFieldDTO> |
getIndexedFields()
Returns details about the fields in the index.
|
Set<IndexFieldDTO> |
getIndexFieldDetails(String... fields)
Gets the details about the SOLR fields using the LukeRequestHandler:
See http://wiki.apache.org/solr/LukeRequestHandler for more information
|
List<LegendItem> |
getLegend(SpatialSearchRequestParams searchParams,
String facetField,
String[] cutpoints)
Get legend items for a query and specified facet.
|
Integer |
getMaxMultiPartThreads() |
Map<String,Integer> |
getOccurrenceCountsForTaxa(List<String> taxa)
Returns the occurrence counts based on lft and rgt values for each of the supplied taxa.
|
List<OccurrencePoint> |
getOccurrences(SpatialSearchRequestParams searchParams,
PointType pointType,
String colourBy,
int searchType)
Retrieve a list of occurrence uid's for a given search
|
protected String[] |
getQueryContextAsArray(String queryContext) |
Map<String,Integer> |
getSourcesForQuery(SpatialSearchRequestParams searchParams)
Obtains a list and facet count of the source uids for the supplied query.
|
protected List<TaxaCountDTO> |
getSpeciesCounts(String queryString,
List<String> filterQueries,
List<String> facetFields,
Integer pageSize,
Integer startIndex,
String sortField,
String sortDirection)
Get a distinct list of species and their counts using a facet search
|
Map<String,org.apache.solr.client.solrj.response.FieldStatsInfo> |
getStatistics(SpatialSearchRequestParams searchParams)
Statistics for each of the fields included as facets.
|
Integer |
getThrottle() |
List<FieldResultDTO> |
getValuesForFacet(SpatialSearchRequestParams requestParams)
Returns the values and counts for a single facet field.
|
protected void |
initDecadeBasedFacet(org.apache.solr.client.solrj.SolrQuery solrQuery,
String field) |
protected org.apache.solr.client.solrj.SolrQuery |
initSolrQuery(SearchRequestParams searchParams,
boolean substituteDefaultFacetOrder,
Map<String,String[]> extraSolrParams)
Helper method to create SolrQuery object and add facet settings
|
void |
refreshCaches()
Refresh any caches in use to populate queries.
|
void |
setMaxMultiPartThreads(Integer maxMultiPartThreads) |
void |
setThrottle(Integer throttle) |
protected void |
updateQueryContext(SearchRequestParams searchParams)
Updates the supplied search params to cater for the query context
|
void |
writeCoordinatesToStream(SearchRequestParams searchParams,
OutputStream out)
Writes all the distinct latitude and longitude in the index to the supplied
output stream.
|
void |
writeFacetToStream(SpatialSearchRequestParams searchParams,
boolean includeCount,
boolean lookupName,
boolean includeSynonyms,
OutputStream out,
DownloadDetailsDTO dd)
Writes the values for the first supplied facet to output stream
|
Map<String,Integer> |
writeResultsFromIndexToStream(DownloadRequestParams downloadParams,
OutputStream out,
boolean includeSensitive,
DownloadDetailsDTO dd,
boolean checkLimit)
Writes the index fields to the supplied output stream in CSV format.
|
Map<String,Integer> |
writeResultsToStream(DownloadRequestParams downloadParams,
OutputStream out,
int i,
boolean includeSensitive,
DownloadDetailsDTO dd)
Note - this method extracts from CASSANDRA rather than the Index.
|
int |
writeSpeciesCountByCircleToStream(SpatialSearchRequestParams searchParams,
String speciesGroup,
javax.servlet.ServletOutputStream out)
Writes the species count in the specified circle to the output stream.
|
protected org.apache.solr.client.solrj.SolrServer server
protected org.apache.solr.client.solrj.SolrRequest.METHOD queryMethod
protected Integer MAX_DOWNLOAD_SIZE
protected Integer downloadBatchSize
public static final String NAMES_AND_LSID
public static final String COMMON_NAME_AND_LSID
protected static final String DECADE_FACET_NAME
protected static final Integer FACET_PAGE_SIZE
protected static final String QUOTE
protected static final char[] CHARS
protected static final String RANGE_SUFFIX
protected Pattern lsidPattern
protected Pattern urnPattern
protected Pattern spacesPattern
protected Pattern uidPattern
protected Pattern spatialPattern
protected Pattern qidPattern
protected Pattern termPattern
protected Pattern indexFieldPatternMatcher
protected Pattern layersPattern
protected DownloadFields downloadFields
@Inject protected SearchUtils searchUtils
@Inject protected AuthService authService
@Inject protected LayersService layersService
protected Boolean usingLocalMediaRepo
protected Integer maxMultiPartThreads
protected Integer termQueryLimit
protected String authServiceFields
public static String biocacheMediaUrl
public static String biocacheMediaDir
public void refreshCaches()
SearchDAOrefreshCaches in interface SearchDAO@Cacheable(cacheName="endemicCache") public List<FieldResultDTO> getEndemicSpecies(SpatialSearchRequestParams requestParams) throws Exception
getEndemicSpecies in interface SearchDAOExceptionpublic List<FieldResultDTO> getValuesForFacet(SpatialSearchRequestParams requestParams) throws Exception
getValuesForFacet in interface SearchDAOExceptionpublic SearchResultDTO findByFulltextSpatialQuery(SpatialSearchRequestParams searchParams, Map<String,String[]> extraParams)
SearchDAOfindByFulltextSpatialQuery in interface SearchDAOSearchDAO.findByFulltextSpatialQuery(au.org.ala.biocache.dto.SpatialSearchRequestParams, java.util.Map<java.lang.String, java.lang.String[]>)public SearchResultDTO findByFulltextSpatialQuery(SpatialSearchRequestParams searchParams, boolean includeSensitive, Map<String,String[]> extraParams)
SearchDAOfindByFulltextSpatialQuery in interface SearchDAOpublic int writeSpeciesCountByCircleToStream(SpatialSearchRequestParams searchParams, String speciesGroup, javax.servlet.ServletOutputStream out) throws Exception
SearchDAOwriteSpeciesCountByCircleToStream in interface SearchDAOExceptionSearchDAO.writeSpeciesCountByCircleToStream(au.org.ala.biocache.dto.SpatialSearchRequestParams, String, javax.servlet.ServletOutputStream)public void writeFacetToStream(SpatialSearchRequestParams searchParams, boolean includeCount, boolean lookupName, boolean includeSynonyms, OutputStream out, DownloadDetailsDTO dd) throws Exception
writeFacetToStream in interface SearchDAOincludeCount - true when the count should be included in the downloadlookupName - true when a name lsid should be looked up in the bieExceptionpublic void writeCoordinatesToStream(SearchRequestParams searchParams, OutputStream out) throws Exception
writeCoordinatesToStream in interface SearchDAOout - Exceptionpublic Map<String,Integer> writeResultsFromIndexToStream(DownloadRequestParams downloadParams, OutputStream out, boolean includeSensitive, DownloadDetailsDTO dd, boolean checkLimit) throws Exception
writeResultsFromIndexToStream in interface SearchDAOdownloadParams - out - includeSensitive - Exceptionpublic Map<String,Integer> writeResultsToStream(DownloadRequestParams downloadParams, OutputStream out, int i, boolean includeSensitive, DownloadDetailsDTO dd) throws Exception
writeResultsToStream in interface SearchDAOincludeSensitive - Whether or not the sensitive values should be included in the downloadExceptionpublic List<OccurrencePoint> getFacetPoints(SpatialSearchRequestParams searchParams, PointType pointType) throws Exception
SearchDAOgetFacetPoints in interface SearchDAOExceptionSearchDAO.getFacetPoints(au.org.ala.biocache.dto.SpatialSearchRequestParams, au.org.ala.biocache.dto.PointType)public List<OccurrencePoint> getOccurrences(SpatialSearchRequestParams searchParams, PointType pointType, String colourBy, int searchType) throws Exception
SearchDAOgetOccurrences in interface SearchDAOExceptionSearchDAO.getOccurrences(au.org.ala.biocache.dto.SpatialSearchRequestParams, au.org.ala.biocache.dto.PointType, String, int)public List<DataProviderCountDTO> getDataProviderCounts() throws Exception
getDataProviderCounts in interface SearchDAOExceptionSearchDAO.getDataProviderCounts()public List<OccurrencePoint> findRecordsForLocation(SpatialSearchRequestParams requestParams, PointType pointType) throws Exception
SearchDAOfindRecordsForLocation in interface SearchDAOExceptionThis is used by explore your areapublic List<TaxaCountDTO> findAllSpeciesByCircleAreaAndHigherTaxa(SpatialSearchRequestParams requestParams, String speciesGroup) throws Exception
SearchDAOfindAllSpeciesByCircleAreaAndHigherTaxa in interface SearchDAOExceptionSearchDAO.findAllSpeciesByCircleAreaAndHigherTaxa(au.org.ala.biocache.dto.SpatialSearchRequestParams, String)public List<FieldResultDTO> findRecordByStateFor(String query) throws Exception
findRecordByStateFor in interface SearchDAOExceptionIS THIS BEGIN USED OR NECESSARYpublic TaxaRankCountDTO calculateBreakdown(BreakdownRequestParams queryParams) throws Exception
calculateBreakdown in interface SearchDAOException@Deprecated public TaxaRankCountDTO findTaxonCountForUid(BreakdownRequestParams breakdownParams, String query) throws Exception
calculateBreakdown(BreakdownRequestParams) insteadSearchDAOfindTaxonCountForUid in interface SearchDAOExceptionSearchDAO.findTaxonCountForUid(au.org.ala.biocache.dto.BreakdownRequestParams, String)protected String buildSpatialQueryString(String fullTextQuery, Float latitude, Float longitude, Float radius)
fullTextQuery - latitude - longitude - radius - protected String buildSpatialQueryString(SpatialSearchRequestParams searchParams)
protected void formatSearchQuery(SpatialSearchRequestParams searchParams)
protected void formatSearchQuery(SpatialSearchRequestParams searchParams, boolean forceQueryFormat)
searchParams - public String formatDisplayStringWithI18n(String displayText)
displayText - protected void updateQueryContext(SearchRequestParams searchParams)
searchParams - protected void initDecadeBasedFacet(org.apache.solr.client.solrj.SolrQuery solrQuery,
String field)
protected org.apache.solr.client.solrj.SolrQuery initSolrQuery(SearchRequestParams searchParams, boolean substituteDefaultFacetOrder, Map<String,String[]> extraSolrParams)
protected List<TaxaCountDTO> getSpeciesCounts(String queryString, List<String> filterQueries, List<String> facetFields, Integer pageSize, Integer startIndex, String sortField, String sortDirection) throws org.apache.solr.client.solrj.SolrServerException
queryString - pageSize - sortField - sortDirection - org.apache.solr.client.solrj.SolrServerExceptionpublic Map<String,Integer> getSourcesForQuery(SpatialSearchRequestParams searchParams) throws Exception
getSourcesForQuery in interface SearchDAOsearchParams - Exceptionpublic Set<IndexFieldDTO> getIndexFieldDetails(String... fields) throws Exception
getIndexFieldDetails in interface SearchDAOExceptionpublic List<FacetResultDTO> getFacetCounts(SpatialSearchRequestParams searchParams) throws Exception
getFacetCounts in interface SearchDAOExceptionpublic Set<IndexFieldDTO> getIndexedFields() throws Exception
getIndexedFields in interface SearchDAOExceptionpublic org.apache.solr.common.SolrDocumentList findByFulltext(SpatialSearchRequestParams searchParams) throws Exception
SearchDAOfindByFulltext in interface SearchDAOExceptionSearchDAO.findByFulltext(SpatialSearchRequestParams)public Map<String,org.apache.solr.client.solrj.response.FieldStatsInfo> getStatistics(SpatialSearchRequestParams searchParams) throws Exception
SearchDAOgetStatistics in interface SearchDAOExceptionSearchDAO.getStatistics(SpatialSearchRequestParams)public List<LegendItem> getLegend(SpatialSearchRequestParams searchParams, String facetField, String[] cutpoints) throws Exception
SearchDAOpublic org.apache.solr.client.solrj.response.FacetField getFacet(SpatialSearchRequestParams searchParams, String facet) throws Exception
Exceptionpublic List<DataProviderCountDTO> getDataProviderList(SpatialSearchRequestParams requestParams) throws Exception
SearchDAOgetDataProviderList in interface SearchDAOExceptionpublic List<TaxaCountDTO> findAllSpecies(SpatialSearchRequestParams requestParams) throws Exception
SearchDAOfindAllSpecies in interface SearchDAOExceptionSearchDAO.findAllSpecies(SpatialSearchRequestParams)public Map<String,Integer> getOccurrenceCountsForTaxa(List<String> taxa) throws Exception
SearchDAOgetOccurrenceCountsForTaxa in interface SearchDAOExceptionpublic Integer getMaxMultiPartThreads()
public void setMaxMultiPartThreads(Integer maxMultiPartThreads)
maxMultiPartThreads - the maxMultiPartThreads to setpublic Integer getThrottle()
public void setThrottle(Integer throttle)
throttle - the throttle to setCopyright © 2014. All rights reserved.