Skip to content

Commit 8b4eaf5

Browse files
committed
refactor(search): update answer filtering logic to align with search specifications
1 parent 63cb868 commit 8b4eaf5

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

search-algolia/algolia.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,8 @@ func (s *SearchAlgolia) SearchQuestions(ctx context.Context, cond *plugin.Search
161161
filters += " AND " + viewsFilter
162162
}
163163

164-
// check answers
165-
if cond.AnswerAmount == 0 {
166-
answersFilter = "answers=0"
167-
filters += " AND " + answersFilter
168-
} else if cond.AnswerAmount > 0 {
164+
// check answers, to align with the search spec
165+
if cond.AnswerAmount > 0 {
169166
answersFilter = "answers>=" + strconv.Itoa(cond.AnswerAmount)
170167
filters += " AND " + answersFilter
171168
}

0 commit comments

Comments
 (0)