fix #158
This commit is contained in:
parent
16c28adc38
commit
156ad5e9e3
3 changed files with 24 additions and 2 deletions
|
@ -32,6 +32,8 @@ public class SearchQuery {
|
|||
|
||||
private String minimumShouldMatch;
|
||||
|
||||
private String defType;
|
||||
|
||||
public String getQuery() {
|
||||
return query;
|
||||
}
|
||||
|
@ -88,6 +90,14 @@ public class SearchQuery {
|
|||
this.minimumShouldMatch = minimumShouldMatch;
|
||||
}
|
||||
|
||||
public String getDefType() {
|
||||
return defType;
|
||||
}
|
||||
|
||||
public void setDefType(String defType) {
|
||||
this.defType = defType;
|
||||
}
|
||||
|
||||
public static class SortField {
|
||||
private String field;
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ public class QueryHelper implements Serializable {
|
|||
|
||||
private static final String _AND_ = " AND ";
|
||||
|
||||
private static final String DEFAULT_OPERATOR = " ";
|
||||
private static final String DEFAULT_OPERATOR = _AND_;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
@ -146,7 +146,7 @@ public class QueryHelper implements Serializable {
|
|||
|
||||
protected String additionalQuery;
|
||||
|
||||
protected int maxFilterQueriesForRole = 3;
|
||||
protected int maxFilterQueriesForRole = Integer.MAX_VALUE;
|
||||
|
||||
protected int timeAllowed = -1;
|
||||
|
||||
|
@ -164,6 +164,8 @@ public class QueryHelper implements Serializable {
|
|||
|
||||
protected String minimumShouldMatch = "100%";
|
||||
|
||||
protected String defType = "edismax";
|
||||
|
||||
protected FacetInfo defaultFacetInfo;
|
||||
|
||||
protected MoreLikeThisInfo defaultMoreLikeThisInfo;
|
||||
|
@ -267,6 +269,7 @@ public class QueryHelper implements Serializable {
|
|||
searchQuery.setQuery(solrQuery);
|
||||
|
||||
searchQuery.setMinimumShouldMatch(minimumShouldMatch);
|
||||
searchQuery.setDefType(defType);
|
||||
|
||||
for (final Map.Entry<String, String> entry : sortFieldMap.entrySet()) {
|
||||
searchQuery.addSortField(entry.getKey(), entry.getValue());
|
||||
|
@ -1374,6 +1377,14 @@ public class QueryHelper implements Serializable {
|
|||
this.minimumShouldMatch = minimumShouldMatch;
|
||||
}
|
||||
|
||||
public String getDefType() {
|
||||
return defType;
|
||||
}
|
||||
|
||||
public void setDefType(String defType) {
|
||||
this.defType = defType;
|
||||
}
|
||||
|
||||
public boolean isAnalysisFieldName(final String fieldName) {
|
||||
for (final String f : supportedAnalysisFields) {
|
||||
if (f.endsWith(fieldName)) {
|
||||
|
|
|
@ -145,6 +145,7 @@ public class SearchService implements Serializable {
|
|||
solrQuery.setStart(start);
|
||||
solrQuery.setRows(rows);
|
||||
solrQuery.set("mm", searchQuery.getMinimumShouldMatch());
|
||||
solrQuery.set("defType", searchQuery.getDefType());
|
||||
for (final Map.Entry<String, String[]> entry : queryHelper
|
||||
.getQueryParamMap().entrySet()) {
|
||||
solrQuery.set(entry.getKey(), entry.getValue());
|
||||
|
|
Loading…
Add table
Reference in a new issue