Skip to content

Releases

v0.3.0 - Postgres full-text search

Choose a tag to compare

@carlosfunk carlosfunk released this 22 Jun 09:20

Added

  • Postgres full-text search on Location: New search_vector
    SearchVectorField on AbstractBaseLocation with a GIN index. The
    vector combines name (weight A) with string and numeric values from
    attributes JSONField (weight B), so attribute contents are
    searchable out of the box without per-project configuration.
  • Auto-installed trigger: location_api_core wires a
    post_migrate signal that installs (and refreshes on every migrate) a
    Postgres trigger on each concrete AbstractBaseLocation subclass's
    table. Existing rows are backfilled on first run. Consumers only need to
    makemigrations after upgrading to pick up the new column and index.

Changed

  • LocationSearchView now uses SearchQuery / SearchRank against
    the new search_vector (web-search syntax, simple FTS config),
    ordered by rank. Supplier name remains searchable via an OR'd
    icontains fallback, since supplier rename propagation is
    deliberately not part of the vector.