Skip to content

Commit

Permalink
fix issue with numeric range queries in query string
Browse files Browse the repository at this point in the history
previously the query string queries were modified to aid in
compatibility with other search systems.  this change:
f391b99
has a problem when combined with:
77101ae
due to the introduction of MatchNoneSearchers being returned
in a case where previously they never would.

the fix for now is to simply return disjunction queries on 0
terms instead.  this ultimately also matches nothing, but avoids
triggering the logic which handles match none searchers in a
special way.
  • Loading branch information
mschoch committed Jun 6, 2017
1 parent 9234339 commit 4c801f2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions search/searcher/search_numeric_range.go
Original file line number Diff line number Diff line change
@@ -57,16 +57,16 @@ func NewNumericRangeSearcher(indexReader index.IndexReader,
termRanges := splitInt64Range(minInt64, maxInt64, 4)
terms := termRanges.Enumerate()
if len(terms) < 1 {
return NewMatchNoneSearcher(indexReader)
// cannot return MatchNoneSearcher because of interaction with
// commit f391b991c20f02681bacd197afc6d8aed444e132
return NewMultiTermSearcherBytes(indexReader, terms, field, boost, options,
true)
}
var err error
terms, err = filterCandidateTerms(indexReader, terms, field)
if err != nil {
return nil, err
}
if len(terms) < 1 {
return NewMatchNoneSearcher(indexReader)
}
if tooManyClauses(len(terms)) {
return nil, tooManyClausesErr()
}

0 comments on commit 4c801f2

Please sign in to comment.