typesense / typesense-go

Go client for Typesense: https://github.com/typesense/typesense
Apache License 2.0
208 stars 55 forks source link

QueryBy is "" if it's not set #173

Closed leapoly closed 1 month ago

leapoly commented 2 months ago

Description

If I omit the field QueryBy doing a search in a single collection (because I'm using a preset), NewSearchCollectionRequest generates an empty query_by and it's wrong. This field should be omitted in the query.

Example:

"https://.....typesense.net:443/collections/Name/documents/search?include_fields=id&page=1&per_page=100&preset=Preset&q=test&query_by="

Steps to reproduce

Don't include QueryBy image

Expected Behavior

Don't add query_by= in the GET.

If I use the MultiSearch, it works image

Actual Behavior

It adds query_by= in the GET

Metadata

Typesense Version: typesense-go v1.1.0

OS: Mac

phiHero commented 1 month ago

Fixed in https://github.com/typesense/typesense-go/pull/174