Skip to content

Commit daeca3a

Browse files
committed
Merge branch 'master' into avoid-pks-seen-on-update
Change smart_text into smart_bytes as in master Conflicts: haystack/management/commands/update_index.py
2 parents f87ff24 + 60c8e52 commit daeca3a

File tree

117 files changed

+3924
-1447
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+3924
-1447
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.settings
12
*.pyc
23
.DS_Store
34
_build
@@ -7,6 +8,8 @@ dist
78
build
89
MANIFEST
910
.tox
11+
env
12+
env3
1013

1114
# Because I'm ghetto like that.
1215
tests/pyelasticsearch.py

.travis.yml

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,32 @@
11
language: python
22
python:
3-
- "2.6"
4-
- "2.7"
5-
- "3.2"
3+
- "2.7"
64

7-
branches:
8-
only:
9-
- travis-config
5+
before_install:
6+
- sudo apt-get update
7+
- sudo apt-get install wajig binutils gdal-bin libproj-dev libgeos-c1 libxapian22 python-xapian default-jdk
8+
- curl https://raw.github.com/moliware/travis-solr/master/travis-solr.sh | SOLR_CONFS="tests/schema.xml tests/solrconfig.xml" SOLR_VERSION=4.4.0 bash
9+
10+
install:
11+
- pip install tox
12+
- pip install -e .
13+
14+
script:
15+
- tox -e $TOX_ENV
16+
17+
env:
18+
- TOX_ENV=py26-django1.4
19+
- TOX_ENV=py26-django1.5
20+
- TOX_ENV=py26-django1.6
21+
- TOX_ENV=py27-django1.4
22+
- TOX_ENV=py27-django1.5
23+
- TOX_ENV=py27-django1.6
24+
- TOX_ENV=py32-django1.5
25+
- TOX_ENV=py32-django1.6
26+
27+
services:
28+
- elasticsearch
29+
30+
notifications:
31+
#irc: "irc.freenode.org#haystack"
32+
email: false

AUTHORS

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,17 @@ Primary Authors:
44
* Matt Croydon (some documentation, sanity checks and the sweet name)
55
* Travis Cline (the original SQ implementation, improvements to ModelSearchIndex)
66
* David Sauve (notanumber) for the Xapian backend, the simple backend and various patches.
7-
* Jannis Leidel
7+
* Jannis Leidel (jezdez)
8+
* Chris Adams (acdha)
9+
* Justin Caratzas (bigjust)
10+
* Andrew Schoen (andrewschoen)
11+
* Dan Watson (dcwatson)
12+
* Matt Woodward (mpwoodward)
13+
* Alex Vidal (avidal)
14+
* Zach Smith (zmsmith)
15+
* Stefan Wehrmeyer (stefanw)
16+
* George Hickman (ghickman)
17+
* Ben Spaulding (benspaulding)
818

919

1020
Thanks to
@@ -69,3 +79,10 @@ Thanks to
6979
* Eric Holscher (ericholscher) for a docs fix.
7080
* Erik Rose (erikrose) for a quick pyelasticsearch-compatibility patch
7181
* Stefan Wehrmeyer (stefanw) for a simple search filter fix
82+
* Dan Watson (dcwatson) for various patches.
83+
* Andrew Schoen (andrewschoen) for the addition of ``HAYSTACK_IDENTIFIER_METHOD``
84+
* Pablo SEMINARIO (pabluk) for a docs fix, and a fix in the ElasticSearch backend.
85+
* Eric Thurgood (ethurgood) for a import fix in the Elasticssearch backend.
86+
* Revolution Systems & The Python Software Foundation for funding a significant portion of the port to Python 3!
87+
* Artem Kostiuk (postatum) for patch allowing to search for slash character in ElasticSearch since Lucene 4.0.
88+
* Luis Barrueco (luisbarrueco) for a simple fix regarding updating indexes using multiple backends.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2009-2012, Daniel Lindsley.
1+
Copyright (c) 2009-2013, Daniel Lindsley.
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without modification,

README.rst

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Haystack
33
========
44

55
:author: Daniel Lindsley
6-
:date: 2012/03/30
6+
:date: 2013/07/28
77

88
Haystack provides modular search for Django. It features a unified, familiar
99
API that allows you to plug in different search backends (such as Solr_,
@@ -33,7 +33,9 @@ Documentation
3333
=============
3434

3535
* Development version: http://docs.haystacksearch.org/
36-
* v1.2.X: http://django-haystack.readthedocs.org/en/v1.2.6/
36+
* v2.1.X: http://django-haystack.readthedocs.org/en/v2.1.0/
37+
* v2.0.X: http://django-haystack.readthedocs.org/en/v2.0.0/
38+
* v1.2.X: http://django-haystack.readthedocs.org/en/v1.2.7/
3739
* v1.1.X: http://django-haystack.readthedocs.org/en/v1.1/
3840

3941

@@ -42,25 +44,9 @@ Requirements
4244

4345
Haystack has a relatively easily-met set of requirements.
4446

45-
* Python 2.5+
46-
* Django 1.3+
47+
* Python 2.6+ or Python 3.3+
48+
* Django 1.5+
4749

4850
Additionally, each backend has its own requirements. You should refer to
4951
http://docs.haystacksearch.org/dev/installing_search_engines.html for more
5052
details.
51-
52-
53-
Commercial Support
54-
==================
55-
56-
If you're using Haystack in a commercial environment, paid support is available
57-
from `Toast Driven`_. Services offered include:
58-
59-
* Advice/help with setup
60-
* Implementation in your project
61-
* Bugfixes in Haystack itself
62-
* Features in Haystack itself
63-
64-
If you're interested, please contact Daniel Lindsley ([email protected]).
65-
66-
.. _`Toast Driven`: http://toastdriven.com/

docs/autocomplete.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ A stripped-down view might look like::
105105

106106

107107
def autocomplete(request):
108-
sqs = SearchQuerySet().autocomplete(request.GET.get('q', ''))[:5]
108+
sqs = SearchQuerySet().autocomplete(content_auto=request.GET.get('q', ''))[:5]
109109
suggestions = [result.title for result in sqs]
110110
# Make sure you return a JSON object, not a bare list.
111111
# Otherwise, you could be vulnerable to an XSS attack.

docs/backend_support.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Elasticsearch
5050
* Stored (non-indexed) fields
5151
* Highlighting
5252
* Spatial search
53-
* Requires: pyelasticsearch 0.4+ & Elasticsearch 0.17.7+
53+
* Requires: elasticsearch-py 0.4.3+ & Elasticsearch 0.17.7+
5454

5555
Whoosh
5656
------
@@ -59,10 +59,11 @@ Whoosh
5959

6060
* Full SearchQuerySet support
6161
* Automatic query building
62+
* "More Like This" functionality
6263
* Term Boosting
6364
* Stored (non-indexed) fields
6465
* Highlighting
65-
* Requires: whoosh (1.1.1+)
66+
* Requires: whoosh (2.0.0+)
6667

6768
Xapian
6869
------
@@ -89,7 +90,7 @@ Backend Support Matrix
8990
+----------------+------------------------+---------------------+----------------+------------+----------+---------------+--------------+---------+
9091
| Elasticsearch | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
9192
+----------------+------------------------+---------------------+----------------+------------+----------+---------------+--------------+---------+
92-
| Whoosh | Yes | Yes | No | Yes | No | Yes | Yes | No |
93+
| Whoosh | Yes | Yes | Yes | Yes | No | Yes | Yes | No |
9394
+----------------+------------------------+---------------------+----------------+------------+----------+---------------+--------------+---------+
9495
| Xapian | Yes | Yes | Yes | Yes | Yes | Yes | Yes (plugin) | No |
9596
+----------------+------------------------+---------------------+----------------+------------+----------+---------------+--------------+---------+

docs/boost.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Despite all being types of boost, they take place at different times and have
2323
slightly different effects on scoring.
2424

2525
Term boost happens at query time (when the search query is run) and is based
26-
around increasing the score is a certain word/phrase is seen.
26+
around increasing the score if a certain word/phrase is seen.
2727

2828
On the other hand, document & field boosts take place at indexing time (when
2929
the document is being added to the index). Document boost causes the relevance

docs/conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,16 @@
3838

3939
# General information about the project.
4040
project = u'Haystack'
41-
copyright = u'2009-2012, Daniel Lindsley'
41+
copyright = u'2009-2013, Daniel Lindsley'
4242

4343
# The version info for the project you're documenting, acts as replacement for
4444
# |version| and |release|, also used in various other places throughout the
4545
# built documents.
4646
#
4747
# The short X.Y version.
48-
version = '2.0'
48+
version = '2.1.1'
4949
# The full version, including alpha/beta/rc tags.
50-
release = '2.0.0-beta'
50+
release = '2.1.1-dev'
5151

5252
# The language for content autogenerated by Sphinx. Refer to documentation
5353
# for a list of supported languages.

docs/faceting.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ What Is Faceting?
88
-----------------
99

1010
Faceting is a way to provide users with feedback about the number of documents
11-
which match terms they may be interested in. At it's simplest, it gives
11+
which match terms they may be interested in. At its simplest, it gives
1212
document counts based on words in the corpus, date ranges, numeric ranges or
1313
even advanced queries.
1414

docs/glossary.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Glossary
55
========
66

7-
Search is a domain full of it's own jargon and definitions. As this may be an
7+
Search is a domain full of its own jargon and definitions. As this may be an
88
unfamiliar territory to many developers, what follows are some commonly used
99
terms and what they mean.
1010

docs/index.rst

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ Elasticsearch_, Whoosh_, Xapian_, etc.) without having to modify your code.
1313

1414
.. note::
1515

16-
This documentation represents the development version of Haystack. For
17-
old versions of the documentation: `1.2`_, `1.1`_.
16+
This documentation represents the development version of Haystack (2.0.x).
17+
For old versions of the documentation: `1.2`_, `1.1`_.
1818

1919
.. _`1.2`: http://django-haystack.readthedocs.org/en/v1.2.6/index.html
2020
.. _`1.1`: http://django-haystack.readthedocs.org/en/v1.1/index.html
@@ -44,6 +44,7 @@ you up and running:
4444
debugging
4545

4646
migration_from_1_to_2
47+
python3
4748
contributing
4849

4950

@@ -109,24 +110,8 @@ Requirements
109110

110111
Haystack has a relatively easily-met set of requirements.
111112

112-
* Python 2.5+
113-
* Django 1.3+
113+
* Python 2.6+ or Python 3.3+
114+
* Django 1.5+
114115

115116
Additionally, each backend has its own requirements. You should refer to
116117
:doc:`installing_search_engines` for more details.
117-
118-
119-
Commercial Support
120-
==================
121-
122-
If you're using Haystack in a commercial environment, paid support is available
123-
from `Toast Driven`_. Services offered include:
124-
125-
* Advice/help with setup
126-
* Implementation in your project
127-
* Bugfixes in Haystack itself
128-
* Features in Haystack itself
129-
130-
If you're interested, please contact Daniel Lindsley ([email protected]).
131-
132-
.. _`Toast Driven`: http://toastdriven.com/

docs/inputtypes.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ Example::
125125

126126
.. class:: haystack.inputs.AltParser
127127

128-
``AltParser`` let's you specify that a portion of the query should use a
128+
``AltParser`` lets you specify that a portion of the query should use a
129129
separate parser in the search engine. This is search-engine-specific, so it may
130130
decrease the portability of your app.
131131

@@ -153,7 +153,7 @@ The ``prepare`` method lets you alter the query the user provided before it
153153
becomes of the main query. It is lazy, called as late as possible, right before
154154
the final query is built & shipped to the engine.
155155

156-
A full, if somewhat silly, example look like::
156+
A full, if somewhat silly, example looks like::
157157

158158
from haystack.inputs import Clean
159159

docs/installing_search_engines.rst

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ somewhere on your ``PYTHONPATH``.
4242

4343
.. note::
4444

45-
``pysolr`` has it's own dependencies that aren't covered by Haystack. For
45+
``pysolr`` has its own dependencies that aren't covered by Haystack. For
4646
best results, you should have an ElementTree variant install (preferably the
4747
``lxml`` variant), ``httplib2`` for timeouts (though it will fall back to
4848
``httplib``) and either the ``json`` module that comes with Python 2.5+ or
@@ -74,7 +74,7 @@ Something like the following is suggested::
7474
suggestions = indexes.FacetCharField()
7575

7676
def prepare(self, obj):
77-
prepared_data = super(NoteIndex, self).prepare(obj)
77+
prepared_data = super(MySearchIndex, self).prepare(obj)
7878
prepared_data['suggestions'] = prepared_data['text']
7979
return prepared_data
8080

@@ -117,8 +117,8 @@ Official Download Location: http://www.elasticsearch.org/download/
117117

118118
Elasticsearch is Java but comes in a pre-packaged form that requires very
119119
little other than the JRE. It's also very performant, scales easily and has
120-
an advanced featureset. Haystack requires at least version 0.17.7 (0.18.6 is
121-
current as of writing). Installation is best done using a package manager::
120+
an advanced featureset. Haystack requires at least version 0.90.0+.
121+
Installation is best done using a package manager::
122122

123123
# On Mac OS X...
124124
brew install elasticsearch
@@ -130,7 +130,7 @@ current as of writing). Installation is best done using a package manager::
130130
elasticsearch -f -D es.config=<path to YAML config>
131131

132132
# Example:
133-
elasticsearch -f -D es.config=/usr/local/Cellar/elasticsearch/0.17.7/config/elasticsearch.yml
133+
elasticsearch -f -D es.config=/usr/local/Cellar/elasticsearch/0.90.0/config/elasticsearch.yml
134134

135135
You may have to alter the configuration to run on ``localhost`` when developing
136136
locally. Modifications should be done in a YAML file, the stock one being
@@ -152,17 +152,16 @@ locally. Modifications should be done in a YAML file, the stock one being
152152
logs: /usr/local/var/log
153153
data: /usr/local/var/data
154154

155-
You'll also need an Elasticsearch binding: pyelasticsearch_ (**NOT**
156-
``pyes``). Place ``pyelasticsearch`` somewhere on your ``PYTHONPATH``
157-
(usually ``python setup.py install`` or ``pip install pyelasticsearch``).
155+
You'll also need an Elasticsearch binding: elasticsearch-py_ (**NOT**
156+
``pyes``). Place ``elasticsearch`` somewhere on your ``PYTHONPATH``
157+
(usually ``python setup.py install`` or ``pip install elasticsearch``).
158158

159-
.. _pyelasticsearch: http://pypi.python.org/pypi/pyelasticsearch/
159+
.. _elasticsearch-py: http://pypi.python.org/pypi/elasticsearch/
160160

161161
.. note::
162162

163-
``pyelasticsearch`` has it's own dependencies that aren't covered by
164-
Haystack. You'll also need ``requests`` & ``simplejson`` for speedier
165-
JSON construction/parsing.
163+
``elasticsearch`` has its own dependencies that aren't covered by
164+
Haystack. You'll also need ``urllib3``.
166165

167166

168167
Whoosh
@@ -172,11 +171,8 @@ Official Download Location: http://bitbucket.org/mchaput/whoosh/
172171

173172
Whoosh is pure Python, so it's a great option for getting started quickly and
174173
for development, though it does work for small scale live deployments. The
175-
current recommended version is 1.3.1+. You can install via PyPI_ using::
176-
177-
sudo easy_install whoosh
178-
# ... or ...
179-
sudo pip install whoosh
174+
current recommended version is 1.3.1+. You can install via PyPI_ using
175+
``sudo easy_install whoosh`` or ``sudo pip install whoosh``.
180176

181177
Note that, while capable otherwise, the Whoosh backend does not currently
182178
support "More Like This" or faceting. Support for these features has recently

docs/other_apps.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ Also provides a queue-based setup, this time centered around Celery. Useful
2828
for keeping the index fresh per model instance or with the included task
2929
to call the ``update_index`` management command instead.
3030

31+
haystack-rqueue
32+
---------------
33+
34+
https://github.com/mandx/haystack-rqueue (2.X compatible)
35+
36+
Also provides a queue-based setup, this time centered around RQ. Useful
37+
for keeping the index fresh using ``./manage.py rqworker``.
38+
3139
django-celery-haystack
3240
----------------------
3341

0 commit comments

Comments
 (0)