Merge pull request #26 from amym-li/contrib
Searching using 'is not' when EDismax is enabled always returns no results
This commit is contained in:
commit
599fc81e39
2 changed files with 6 additions and 3 deletions
|
|
@ -160,9 +160,11 @@ class AdvancedSearchQuery {
|
|||
$isSearchAllFields = false;
|
||||
$fields_list = [];
|
||||
|
||||
|
||||
if (!$isDismax) {
|
||||
// To support negative queries we must first bring in all documents.
|
||||
$q[] = $this->negativeQuery($terms) ? "*:*" : "";
|
||||
}
|
||||
|
||||
$term = array_shift($terms);
|
||||
$q[] = $term->toSolrQuery($field_mapping);
|
||||
|
||||
|
|
|
|||
|
|
@ -302,7 +302,8 @@ class AdvancedSearchQueryTerm {
|
|||
return $value;
|
||||
}
|
||||
else {
|
||||
return "(" .$value . " OR " . str_replace('"', "", trim($value)) . ")";
|
||||
$isNot = $this->getInclude() ? "" : "!";
|
||||
return $isNot . "(" .$value . " OR " . str_replace('"', "", trim($value)) . ")";
|
||||
}
|
||||
}
|
||||
if (!$this->getInclude()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue