Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Fixes for #568 and #549" #582

Merged
merged 1 commit into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading