func PageSize(size int) *PageSizeSelector {
	switch {
	case size < 1:
		size = 1
	case size > 1000:
		size = 1000
	}
	return &PageSizeSelector{size: size}
}
PageSize specifies the size of each page in the result. The default value is 100 and can support a minimum of 1 or a maximum of 1000.
If size provided is < 1 it will be set to 1, if it's > 1000 it will be set to 1000.
Example: wowsearch.PageSize(20) // Will return 20 items
Example: wowsearch.PageSize(1337) // Size will be set to 1000
Example: wowsearch.PageSize(-2) // Size will be set to 1
package wowsearch
import (
	"fmt"
	"net/url"
	"strings"
)
type Opt interface {
	Apply(*[]string)
}
func Field() *FieldSelector {
	return &FieldSelector{}
}
type FieldSelector struct {
	parts []string
}
func (s *FieldSelector) AND(field, value string) *FieldSelector {
	s.parts = append(s.parts, fmt.Sprintf("%s=%s", url.QueryEscape(field), url.QueryEscape(value)))
	return s
}
func (s *FieldSelector) OR(field string, values ...string) *FieldSelector {
	for i, val := range values {
		values[i] = url.QueryEscape(val)
	}
	s.parts = append(s.parts, fmt.Sprintf("%s=%s", url.QueryEscape(field), strings.Join(values, "||")))
	return s
}
func (s *FieldSelector) NOT(field, value string) *FieldSelector {
	s.parts = append(s.parts, fmt.Sprintf("%s!=%s", url.QueryEscape(field), url.QueryEscape(value)))
	return s
}
func (s *FieldSelector) RANGE(field string, start, stop int) *FieldSelector {
	s.parts = append(s.parts, fmt.Sprintf("%s=[%d,%d]", url.QueryEscape(field), start, stop))
	return s
}
func (s *FieldSelector) MIN(field string, value int) *FieldSelector {
	s.parts = append(s.parts, fmt.Sprintf("%s=[%d,]", url.QueryEscape(field), value))
	return s
}
func (s *FieldSelector) MAX(field string, value int) *FieldSelector {
	s.parts = append(s.parts, fmt.Sprintf("%s=[,%d]", url.QueryEscape(field), value))
	return s
}
func (s *FieldSelector) Apply(v *[]string) {
	*v = append(*v, strings.Join(s.parts, "&"))
}
func Page(page int) Opt {
	if page < 1 {
		page = 1
	}
	return &PageSelector{page: page}
}
type PageSelector struct {
	page int
}
func (s *PageSelector) Apply(v *[]string) {
	*v = append(*v, fmt.Sprintf("_page=%d", s.page))
}