Metadata-Version: 2.1
Name: django-oscar-pg-search
Version: 0.8.6
Summary: Pure Postgresql search backend for Django Oscar
Author: Snake-Soft
Author-email: info@snake-soft.com
License: BSD
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 3.0
Classifier: Framework :: Django :: 3.1
Classifier: Framework :: Django :: 3.2
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: Unix
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Provides-Extra: test


.. image:: https://github.com/snake-soft/django-oscar-pg-search/actions/workflows/django.yml/badge.svg
   :target: https://github.com/snake-soft/django-oscar-pg-search/actions/workflows/django.yml
   :alt: Maintainability

.. image:: https://api.codeclimate.com/v1/badges/a289293e4e1af1114d74/maintainability
   :target: https://codeclimate.com/github/snake-soft/django-oscar-pg-search/maintainability
   :alt: Maintainability

.. image:: https://codecov.io/gh/snake-soft/django-oscar-pg-search/branch/master/graph/badge.svg?token=TALCIZ5E3Q
   :target: https://codecov.io/gh/snake-soft/django-oscar-pg-search

.. image:: https://img.shields.io/badge/License-GPLv3-blue.svg
   :target: https://www.gnu.org/licenses/gpl-3.0

==========================================
Postgresql search handler for Django-Oscar
==========================================

Careful: This is originally created inside a project not tested in a reusable environment, yet.

This creates a search handler without the need of any search backend.
It is designed for the e-commerce framework `Oscar`_.

.. _`Oscar`: https://github.com/django-oscar/django-oscar


It is implemented a little bit expensive but uses 4 annotated search vectors:
* upc
* title
* meta_description
* meta_title

This way the search can be manipulated through the meta fields.
This package is not testet against generic sites, yet.
It is running productive in a heavily customized env for many months now.
I think it should scale up to 5000 Products with 10 Attributes depending on how the products are loaded.
We use it fully lazy with endless scrolling.


To-Do
-----
* Dynamic creation of the filter fields
* Writing Tests


Features
--------

* Don't need to use some additional search backend like elastic
* Creates filters (facets) for:
	* Data that is directly attached to the Product model including foreign key choices
	* AttributeValues of the products
	* StockRecord entries


Installation
------------

Install using pip:

.. code-block:: bash

	pip install django-oscar-pg-search


.. code-block:: python

   # settings.py
   INSTALLED_APPS = [
       # ...
       'oscar_pg_search.apps.PgSearchConfig',
       # ...
   ]
   OSCAR_PRODUCT_SEARCH_HANDLER = 'oscar_pg_search.postgres_search_handler.PostgresSearchHandler'

Settings
--------

If you want to add some fields that are directly attached to the Product model:

.. code-block:: python

   # settings.py
   OSCAR_ATTACHED_PRODUCT_FIELDS = ['is_public', 'deposit', 'volume', 'weight',]


