Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 1.9.1 instead.
Reason given by maintainers: Too many breaking changes for a patch release

Haystack for Django REST Framework

Build status

Coverage Status PyPI version Documentation Status

About

Small library which tries to simplify integration of Haystack with Django REST Framework. Fresh documentation available on Read the docs!

Supported versions

  • Python >=3.11, <3.15
  • Django >=5.2, <6.2
  • Haystack >=3.3.0, <4
  • Django REST Framework >=3.16
  • Elasticsearch >=7.0.0, <8

Installation

$ pip install drf-haystack

Supported features

We aim to support most features Haystack does (or at least those which can be used in a REST API). Currently, we support:

  • Autocomplete
  • Boost (Experimental)
  • Faceting
  • Geo Spatial Search
  • Highlighting
  • More Like This

Show me more!

from drf_haystack.serializers import HaystackSerializer
from drf_haystack.viewsets import HaystackViewSet

from myapp.search_indexes import PersonIndex  # You would define this Index normally as per Haystack's documentation


# Serializer
class PersonSearchSerializer(HaystackSerializer):
    class Meta:
        index_classes = [PersonIndex]
        fields = ["firstname", "lastname", "full_name"]


# ViewSet
class PersonSearchViewSet(HaystackViewSet):
    index_models = [Person]
    serializer_class = PersonSerializer

That's it, you're good to go. Hook it up to a DRF router and happy searching!

Release files for drf-haystack 1.9.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for drf-haystack 1.9.3
File Size Uploaded
drf_haystack-1.9.3.tar.gz 59.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for drf-haystack 1.9.3
File Interpreter ABI Platform
drf_haystack-1.9.3-py3-none-any.whl Python 3 none any Details

Total release size: 78.4 kB

Release files / drf_haystack-1.9.3.tar.gz

Download URL drf_haystack-1.9.3.tar.gz
Size 59.0 kB
Tags Source
SHA-256 checksum
How to use checksums
547df25d77d241824e033c41252a92d8d194456f8b28fe7e6a90588381aba266
BLAKE2b-256 checksum
How to use checksums
96153a628cedea34bb61ae20c42c6d5b11662c9d975bfcb6ec46de0cdc1e2a22
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / drf_haystack-1.9.3-py3-none-any.whl

Download URL drf_haystack-1.9.3-py3-none-any.whl
Size 19.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
51d7b8f1ca0d540d90ecc080a610d1b7d40ec1e4e3f5d96cd02c655b1e4f5df5
BLAKE2b-256 checksum
How to use checksums
6c2351d0360737fbdc8bac5e00cbfe89e884fe4e4d93b4504b875b2cb8588c81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

1.9.3 This release

2 release files

1.9.1

2 release files

1.9

2 release files

1.8.11

2 release files

1.8.9

2 release files

1.8.8

2 release files

1.8.7

2 release files

1.8.6

2 release files

1.8.5

2 release files

1.8.4

2 release files

1.8.3

2 release files

1.8.2

2 release files

1.8.1

2 release files

1.6.1

1 release file

1.6.0

1 release file

1.5.6

1 release file

1.5.5

1 release file

1.5.4

1 release file

1.5.3

1 release file

1.5.2

1 release file

1.5.1

1 release file

1.5.0

1 release file

1.4

1 release file

1.3

1 release file

1.2

1 release file

1.1

1 release file

1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page