@@ -16,7 +16,7 @@ a small window passed over the string). Because this alters the way your
16
16
data needs to be stored, the best approach is to add a new field to your
17
17
``SearchIndex `` that contains the text you want to autocomplete on.
18
18
19
- You have two choices: ``NgramField `` & ``EdgeNgramField ``. Though very similar,
19
+ You have two choices: ``NgramField `` and ``EdgeNgramField ``. Though very similar,
20
20
the choice of field is somewhat important.
21
21
22
22
* If you're working with standard text, ``EdgeNgramField `` tokenizes on
@@ -54,14 +54,14 @@ Step 2. Performing The Query
54
54
============================
55
55
56
56
Haystack ships with a convenience method to perform most autocomplete searches.
57
- You simply provide a field & the query you wish to search on to the
57
+ You simply provide a field and the query you wish to search on to the
58
58
``SearchQuerySet.autocomplete `` method. Given the previous example, an example
59
59
search would look like::
60
60
61
61
from haystack.query import SearchQuerySet
62
62
63
63
SearchQuerySet().autocomplete(content_auto='old')
64
- # Result match things like 'goldfish', 'cuckold' & 'older'.
64
+ # Result match things like 'goldfish', 'cuckold' and 'older'.
65
65
66
66
The results from the ``SearchQuerySet.autocomplete `` method are full search
67
67
results, just like any regular filter.
@@ -82,14 +82,14 @@ Example Implementation
82
82
83
83
The above is the low-level backend portion of how you implement autocomplete.
84
84
To make it work in browser, you need both a view to run the autocomplete
85
- & some Javascript to fetch the results.
85
+ and some Javascript to fetch the results.
86
86
87
87
Since it comes up often, here is an example implementation of those things.
88
88
89
89
.. warning ::
90
90
91
91
This code comes with no warranty. Don't ask for support on it. If you
92
- copy-paste it & it burns down your server room, I'm not liable for any
92
+ copy-paste it and it burns down your server room, I'm not liable for any
93
93
of it.
94
94
95
95
It worked this one time on my machine in a simulated environment.
@@ -133,7 +133,7 @@ The template might look like::
133
133
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
134
134
<script type="text/javascript">
135
135
// In a perfect world, this would be its own library file that got included
136
- // on the page & only the ``$(document).ready(...)`` below would be present.
136
+ // on the page and only the ``$(document).ready(...)`` below would be present.
137
137
// But this is an example.
138
138
var Autocomplete = function(options) {
139
139
this.form_selector = options.form_selector
0 commit comments