Skip to content

Commit

Permalink
test case for facetquery added
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathew Varghese committed Jul 31, 2018
1 parent 4612f07 commit 6b8f222
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions solr/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,17 @@ func TestSolrQueryAddFacet(t *testing.T) {
}
}

func TestSolrQueryAddFacetQuery(t *testing.T) {
q := NewQuery()
q.AddFacetQuery("price:[* TO 500]")
q.AddFacetQuery("price:[501 TO *]")
expected := "facet=true&facet.query=price%3A%5B%2A+TO+500%5D&facet.query=price%3A%5B501+TO+%2A%5D"
result := q.String()
if result != expected {
t.Errorf("expected '%s' but got '%s'", expected, result)
}
}

func TestSolrQuerySetFacetMinCount(t *testing.T) {
q := NewQuery()
q.SetFacetMinCount(10)
Expand Down

0 comments on commit 6b8f222

Please sign in to comment.