Boolean limitToGalleries, Boolean includeTaxonDescriptions, Boolean includeOccurrences,\r
Boolean includeTaxonNameDescriptions, List<String> propertyPath) {\r
\r
+ // logger.setLevel(Level.TRACE);\r
+// Logger.getLogger("org.hibernate.SQL").setLevel(Level.TRACE);\r
+\r
logger.trace("listMedia() - START");\r
\r
Set<Taxon> taxa = new HashSet<Taxon>();\r
if (name != null && config.isDeleteNameIfPossible()){\r
nameResult = nameService.delete(name, config.getNameDeletionConfig());\r
}\r
- \r
+\r
if (nameResult.isError()){\r
//result.setError();\r
result.addRelatedObject(name);\r
// ---- search criteria\r
luceneSearch.setCdmTypRestriction(clazz);\r
\r
- textQuery.add(taxonBaseQueryFactory.newTermQuery("titleCache", queryString), Occur.SHOULD);\r
- textQuery.add(taxonBaseQueryFactory.newDefinedTermQuery("name.rank", queryString, languages), Occur.SHOULD);\r
+ if(!queryString.isEmpty() && !queryString.equals("*") && !queryString.equals("?") ) {\r
+ textQuery.add(taxonBaseQueryFactory.newTermQuery("titleCache", queryString), Occur.SHOULD);\r
+ textQuery.add(taxonBaseQueryFactory.newDefinedTermQuery("name.rank", queryString, languages), Occur.SHOULD);\r
+ }\r
+\r
+ if(textQuery.getClauses().length > 0) {\r
+ finalQuery.add(textQuery, Occur.MUST);\r
+ }\r
\r
- finalQuery.add(textQuery, Occur.MUST);\r
\r
if(classification != null){\r
finalQuery.add(taxonBaseQueryFactory.newEntityIdQuery("taxonNodes.classification.id", classification), Occur.MUST);\r
List<TaxonBase> taxonList = dao.getTaxaByName(true, false, false, config.getTaxonNameTitle(), null, MatchMode.EXACT, null, 0, 0, config.getPropertyPath());\r
return taxonList;\r
}\r
- \r
+\r
@Override\r
@Transactional(readOnly = true)\r
public <S extends TaxonBase> Pager<FindByIdentifierDTO<S>> findByIdentifier(\r
if (subtreeFilter == null){\r
return findByIdentifier(clazz, identifier, identifierType, matchmode, includeEntity, pageSize, pageNumber, propertyPaths);\r
}\r
- \r
+\r
Integer numberOfResults = dao.countByIdentifier(clazz, identifier, identifierType, subtreeFilter, matchmode);\r
List<Object[]> daoResults = new ArrayList<Object[]>();\r
if(numberOfResults > 0) { // no point checking again\r
daoResults = dao.findByIdentifier(clazz, identifier, identifierType, subtreeFilter,\r
matchmode, includeEntity, pageSize, pageNumber, propertyPaths);\r
}\r
- \r
+\r
List<FindByIdentifierDTO<S>> result = new ArrayList<FindByIdentifierDTO<S>>();\r
for (Object[] daoObj : daoResults){\r
if (includeEntity){\r
result.add(new FindByIdentifierDTO<S>((DefinedTerm)daoObj[0], (String)daoObj[1], (S)daoObj[2]));\r
}else{\r
- result.add(new FindByIdentifierDTO<S>((DefinedTerm)daoObj[0], (String)daoObj[1], (UUID)daoObj[2], (String)daoObj[3])); \r
+ result.add(new FindByIdentifierDTO<S>((DefinedTerm)daoObj[0], (String)daoObj[1], (UUID)daoObj[2], (String)daoObj[3]));\r
}\r
}\r
return new DefaultPagerImpl<FindByIdentifierDTO<S>>(pageNumber, numberOfResults, pageSize, result);\r
@Override\r
public SynonymRelationship moveSynonymToAnotherTaxon(SynonymRelationship oldSynonymRelation, UUID newTaxonUUID, boolean moveHomotypicGroup,\r
SynonymRelationshipType newSynonymRelationshipType, Reference reference, String referenceDetail, boolean keepReference) throws HomotypicalGroupChangeException {\r
- \r
+\r
Taxon newTaxon = (Taxon) dao.load(newTaxonUUID);\r
return moveSynonymToAnotherTaxon(oldSynonymRelation, newTaxon, moveHomotypicGroup, newSynonymRelationshipType, reference, referenceDetail, keepReference);\r
}\r