Commit 326820b6 authored by Jérémy Destin's avatar Jérémy Destin
Browse files

fix: Add taxonCommonNames in the germplasm search criteria.GNP-4309

parent c305c41f
......@@ -8,6 +8,9 @@ import fr.inra.urgi.faidare.elasticsearch.criteria.annotation.NoDocumentMapping;
import java.util.List;
/**
* @author jdestin
*/
@CriteriaForDocument(GermplasmVO.class)
public class FaidareGermplasmPOSTShearchCriteria extends GermplasmPOSTSearchCriteria implements SortCriteria {
......@@ -44,6 +47,9 @@ public class FaidareGermplasmPOSTShearchCriteria extends GermplasmPOSTSearchCrit
@DocumentPath("taxonSynonyms")
private List<String> taxonSynonyms;
@DocumentPath("taxonCommonNames")
private List<String> taxonCommonNames;
@DocumentPath(value = {"holdingInstitute", "organisation"})
private List<String> holdingInstitute;
......@@ -123,6 +129,14 @@ public class FaidareGermplasmPOSTShearchCriteria extends GermplasmPOSTSearchCrit
public void setSynonyms(List<String> synonyms) { this.synonyms = synonyms; }
public List<String> getTaxonCommonNames() {
return taxonCommonNames;
}
public void setTaxonCommonNames(List<String> taxonCommonNames) {
this.taxonCommonNames = taxonCommonNames;
}
public List<String> getHoldingInstitute() {
return holdingInstitute;
}
......
......@@ -22,7 +22,7 @@ import static org.elasticsearch.index.query.QueryBuilders.*;
* Generic Elasticsearch query generator for criteria mapped on value object via
* {@link DocumentPath} annotations
*
* @author gcornut
* @author gcornut, jdestin
*/
public class ESGenericQueryFactory<C> implements ESQueryFactory<C> {
......@@ -373,9 +373,10 @@ public class ESGenericQueryFactory<C> implements ESQueryFactory<C> {
} else if (queries.size() == 1) {
return queries.get(0);
} else {
// List of the criteria that will be use in should query part, the other criteria will be used as filter.
List<String> shouldCriterion = Arrays.asList("commonCropName",
"species", "germplasmGenus", "genusSpecies", "subtaxa", "genus",
"genusSpeciesSubtaxa", "taxonSynonyms", "panel", "collection", "population",
"genusSpeciesSubtaxa", "taxonSynonyms", "taxonCommonNames", "panel", "collection", "population",
"germplasmName", "accessionNumber", "synonyms");
BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();
BoolQueryBuilder boolShouldQueryBuilder = QueryBuilders.boolQuery();
......
......@@ -25,7 +25,7 @@ import java.util.Iterator;
import java.util.List;
/**
* @author cpommier, gcornut
* @author cpommier, gcornut, jdestin
*/
@Service("germplasmService")
public class GermplasmServiceImpl implements GermplasmService {
......
......@@ -214,6 +214,7 @@ describe('GermplasmResultPageComponent', () => {
subtaxa: null,
genusSpeciesSubtaxa: null,
taxonSynonyms: null,
taxonCommonNames: null,
biologicalStatus: null,
geneticNature: null,
holdingInstitute: null,
......
......@@ -108,6 +108,7 @@ export class GermplasmResultPageComponent implements OnInit {
subtaxa: asArray(criteria.crops),
genusSpeciesSubtaxa: asArray(criteria.crops),
taxonSynonyms: asArray(criteria.crops),
taxonCommonNames: asArray(criteria.crops),
panel: asArray(criteria.germplasmLists),
collection: asArray(criteria.germplasmLists),
......
......@@ -148,6 +148,7 @@ describe('GnpisService', () => {
subtaxa: null,
genusSpeciesSubtaxa: null,
taxonSynonyms: null,
taxonCommonNames: null,
biologicalStatus: null,
geneticNature: null,
holdingInstitute: null,
......
......@@ -62,6 +62,7 @@ export class DataDiscoveryCriteriaUtils {
subtaxa: null,
genusSpeciesSubtaxa: null,
taxonSynonyms: null,
taxonCommonNames: null,
biologicalStatus: null,
geneticNature: null,
sources: null,
......
......@@ -19,6 +19,7 @@ export interface GermplasmSearchCriteria {
subtaxa: string[];
genusSpeciesSubtaxa: string[];
taxonSynonyms: string[];
taxonCommonNames: string[];
biologicalStatus: string[];
geneticNature: string[];
holdingInstitute: string[];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment