django-simplesearch

A basic search application for Django
Download

django-simplesearch Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Other/Proprietary Li...
  • Price:
  • FREE
  • Publisher Name:
  • Julien Phalip and Peter Hogg
  • Publisher web site:
  • https://github.com/pigmonkey/

django-simplesearch Tags


django-simplesearch Description

django-simplesearch is a reusable Django app for simple searching, based on Julien Phalip's original code.How it WorksA string of search terms are passed to the get_query function, along with a list of the model fields to search. These terms are normalized by normalize_query, which splits the query string into individual keyword, keeping quoted words together and removing stop words. The get_query function then returns a Q object which may be used to search the given fields for the given term.Installationdjango-simplesearch is available on PyPI and can be installed with PIP.pip install django-simplesearchAlternatively, you may download the source and install it.python setup.py installSetupAdd simplesearch to your settings.INSTALLED_APPS.Usagedjango-simplesearch was created to search blog posts. To search a model Post in the fields title and body based on a search query submitted by a form to HTTP GET, you might do something like this:if 'q' in request.GET: query_string = request.GET entry_query = get_query(query_string, ) results = Post.objects.published().filter(entry_query).distinct()In this case, the Post objects that matched the search query is stored within results.Product's homepage


django-simplesearch Related Software