search

package
v0.0.34 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var WithinKmOptions = []int{1, 5, 10, 25, 50, 100, 500, 1000}

WithinKmOptions are valid search within-distance dropdown values (kilometers).

View Source
var WithinMileOptions = []int{1, 5, 10, 25, 50, 100, 500, 1000}

WithinMileOptions are valid search within-distance dropdown values (miles).

Functions

This section is empty.

Types

type Params

type Params struct {
	CategoryID   int
	UserID       int
	Limit        int
	Offset       int
	Q            string
	FacetFilters map[string]facet.Filter
	// CenterLat/CenterLon and WithinKm apply when location text resolved and within > 0.
	CenterLat float64
	CenterLon float64
	WithinKm  float64
	HasGeo    bool
}

Params holds hard filters for listing search.

func BuildParams

func BuildParams(categoryID, limit, offset int, q, locationText string,
	within int, withinUnit string, facetFilters map[string]facet.Filter) Params

BuildParams converts filter fields into search Params, resolving geo when applicable.

func (Params) HasTextQuery

func (p Params) HasTextQuery() bool

type Results

type Results struct {
	IDs          []int
	InAreaOnPage int
	HasAnyInArea bool
}

Results holds vector search output. For geo searches, InAreaOnPage and HasAnyInArea drive the outside-area heading without a global in-area count.

func Search(p Params) (Results, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL