diff --git a/backend/src/main/java/uk/ac/ebi/spot/ols/repository/solr/OlsSolrQuery.java b/backend/src/main/java/uk/ac/ebi/spot/ols/repository/solr/OlsSolrQuery.java index b74500a84..58a895d67 100644 --- a/backend/src/main/java/uk/ac/ebi/spot/ols/repository/solr/OlsSolrQuery.java +++ b/backend/src/main/java/uk/ac/ebi/spot/ols/repository/solr/OlsSolrQuery.java @@ -68,8 +68,7 @@ public SolrQuery constructQuery() { if(qf.length() > 0) { qf.append(" "); } - qf.append(ClientUtils.escapeQueryChars( getSolrPropertyName(searchField.propertyName, - exactMatch ? SearchType.WHOLE_FIELD : searchField.searchType)) ); + qf.append(ClientUtils.escapeQueryChars( getSolrPropertyName(searchField.propertyName, exactMatch ? SearchType.WHOLE_FIELD : searchField.searchType)) ); qf.append("^"); qf.append(searchField.weight); } @@ -178,25 +177,22 @@ public BoostField(String propertyName, String propertyValue, int weight, SearchT } private String getSolrPropertyName(String propertyName, SearchType searchType) { - if (propertyName.compareTo("_json") == 0) - return propertyName; - else - switch(searchType) { - case CASE_INSENSITIVE_TOKENS: - return "lowercase_" + propertyName; - case CASE_SENSITIVE_TOKENS: - return propertyName; - case WHOLE_FIELD: - return "str_" + propertyName; - case EDGES: - return "edge_" + propertyName; - case WHITESPACE: - return "whitespace_" + propertyName; - case WHITESPACE_EDGES: - return "whitespace_edge_" + propertyName; - default: - throw new RuntimeException("unknown filter accuracy"); - } + switch(searchType) { + case CASE_INSENSITIVE_TOKENS: + return "lowercase_" + propertyName; + case CASE_SENSITIVE_TOKENS: + return propertyName; + case WHOLE_FIELD: + return "str_" + propertyName; + case EDGES: + return "edge_" + propertyName; + case WHITESPACE: + return "whitespace_" + propertyName; + case WHITESPACE_EDGES: + return "whitespace_edge_" + propertyName; + default: + throw new RuntimeException("unknown filter accuracy"); + } } private String getSolrPropertyValue(String propertyValue, SearchType searchType) { diff --git a/backend/src/main/java/uk/ac/ebi/spot/ols/repository/v2/helpers/V2SearchFieldsParser.java b/backend/src/main/java/uk/ac/ebi/spot/ols/repository/v2/helpers/V2SearchFieldsParser.java index a39c1b461..6a2cff813 100644 --- a/backend/src/main/java/uk/ac/ebi/spot/ols/repository/v2/helpers/V2SearchFieldsParser.java +++ b/backend/src/main/java/uk/ac/ebi/spot/ols/repository/v2/helpers/V2SearchFieldsParser.java @@ -25,7 +25,6 @@ public static void addSearchFieldsToQuery(OlsSolrQuery query, String searchField query.addSearchField(field.property, field.weight, SearchType.CASE_INSENSITIVE_TOKENS); } } - query.addSearchField("_json", 1, SearchType.CASE_INSENSITIVE_TOKENS); } public static void addBoostFieldsToQuery(OlsSolrQuery query, String boostFields) {