Git Product home page Git Product logo

xapian-haystack's Introduction

Xapian backend for Django-Haystack

https://travis-ci.org/notanumber/xapian-haystack.svg?branch=master

Xapian-haystack is a backend of Django-Haystack for the Xapian search engine. Thanks for checking it out.

You can find more information about Xapian here.

Features

Xapian-Haystack provides all the standard features of Haystack:

  • Weighting
  • Faceted search (date, query, etc.)
  • Sorting
  • Spelling suggestions
  • EdgeNGram and Ngram (for autocomplete)

Requirements

  • Python 2.4+ (Python 3.3 not support yet).
  • Django 1.6+
  • Django-Haystack 2.0.X
  • Xapian 1.0.13+

In particular, we build this backend on Travis using:

  • Python 2.7.6
  • Django 1.6, 1.7 and 1.8
  • Django-Haystack (master)
  • Xapian 1.2.8 (libxapian22)

Installation

First you need to install Xapian in your machine. We recommend installing it on the virtual environment using this gist: activate the virtual environment and run the script.

You can test if the installation was successful by running:

python -c "import xapian"

Finally, install Xapian-Haystack by running:

pip install git+https://github.com/notanumber/xapian-haystack.git

Configuration

Xapian is configured as other backends of Haystack. You have to define the connection to the database, which is done to a path to a directory, e.g:

HAYSTACK_CONNECTIONS = {
    'default': {
        'ENGINE': 'xapian_backend.XapianEngine',
        'PATH': os.path.join(os.path.dirname(__file__), 'xapian_index')
    },
}

The backend has the following optional settings:

  • HAYSTACK_XAPIAN_LANGUAGE: the stemming language; the default is english and the list of available languages can be found here.
  • HAYSTACK_XAPIAN_WEIGHTING_SCHEME: a tuple with parameters to be passed to the weighting scheme BM25. By default, it uses the same parameters as Xapian recommends; this setting allows you to change them.
  • HAYSTACK_XAPIAN_FLAGS: the options used to parse AutoQueries; the default is FLAG_PHRASE | FLAG_BOOLEAN | FLAG_LOVEHATE | FLAG_WILDCARD | FLAG_PURE_NOT See here for more information on what they mean.
  • HAYSTACK_XAPIAN_STEMMING_STRATEGY: This option lets you chose the stemming strategy used by Xapian. Possible values are STEM_NONE, STEM_SOME, STEM_ALL, STEM_ALL_Z, where STEM_SOME is the default. See here for more information about the different strategies.

Testing

Xapian-Haystack has a test suite in continuous deployment in Travis. The script .travis.yml contains the steps required to run the test suite.

Source

The source code can be found in github.

Credits

Xapian-Haystack is maintained by Jorge C. Leitão; David Sauve was the main contributor of Xapian-Haystack and Xapian-Haystack was originally funded by Trapeze. ANtlord implemented support for EdgeNgram and Ngram.

License

Xapian-haystack is free software licenced under GNU General Public Licence v2 and Copyright (c) 2009, 2010, 2011, 2012 David Sauve, 2009, 2010 Trapeze, 2014 Jorge C. Leitão. It may be redistributed under the terms specified in the LICENSE file.

Questions, Comments, Concerns:

Feel free to open an issue here or pull request your work.

You can ask questions on the django-haystack mailing list or in the irc #haystack.

xapian-haystack's People

Contributors

claudep avatar jezdez avatar jorgecarleitao avatar jrast avatar mop avatar notanumber avatar symroe avatar toastdriven avatar viorels avatar wshallum avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.