package uk.ac.ebi.quickgo.rest.controller.search;

import org.springframework.stereotype.Component;

/**
 * Checks if a given value is a searchable field
 */
@Component
public class OntologyFieldSpec implements SearchableField {
    public enum Search {
        synonymName,
        id,
        name,
        definition
    }

    @Override public boolean isSearchable(String field) {
        for (Search searchableField : Search.values()) {
            if (searchableField.name().equals(field)) {
                return true;
            }
        }
        return false;
    }

}

@@ -312,16 +312,54 @@
 finition
+,%0A        aspect,%0A        ontologyType
 %0A    %7D%0A%0A

Add aspect and ontologyType to list of queryable fields.