From dd2d1e8aa946f5cc410ac7b58bd5773354e7077a Mon Sep 17 00:00:00 2001 From: Toby Champion Date: Sun, 9 Mar 2014 22:06:30 -0700 Subject: [PATCH] Improve punctuation in super-scary YMMV warning --- docs/autocomplete.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/autocomplete.rst b/docs/autocomplete.rst index 9c73f701e..0ff700503 100644 --- a/docs/autocomplete.rst +++ b/docs/autocomplete.rst @@ -16,7 +16,7 @@ a small window passed over the string). Because this alters the way your data needs to be stored, the best approach is to add a new field to your ``SearchIndex`` that contains the text you want to autocomplete on. -You have two choices: ``NgramField`` & ``EdgeNgramField``. Though very similar, +You have two choices: ``NgramField`` and ``EdgeNgramField``. Though very similar, the choice of field is somewhat important. * If you're working with standard text, ``EdgeNgramField`` tokenizes on @@ -54,14 +54,14 @@ Step 2. Performing The Query ============================ Haystack ships with a convenience method to perform most autocomplete searches. -You simply provide a field & the query you wish to search on to the +You simply provide a field and the query you wish to search on to the ``SearchQuerySet.autocomplete`` method. Given the previous example, an example search would look like:: from haystack.query import SearchQuerySet SearchQuerySet().autocomplete(content_auto='old') - # Result match things like 'goldfish', 'cuckold' & 'older'. + # Result match things like 'goldfish', 'cuckold' and 'older'. The results from the ``SearchQuerySet.autocomplete`` method are full search results, just like any regular filter. @@ -82,14 +82,14 @@ Example Implementation The above is the low-level backend portion of how you implement autocomplete. To make it work in browser, you need both a view to run the autocomplete -& some Javascript to fetch the results. +and some Javascript to fetch the results. Since it comes up often, here is an example implementation of those things. .. warning:: This code comes with no warranty. Don't ask for support on it. If you - copy-paste it & it burns down your server room, I'm not liable for any + copy-paste it and it burns down your server room, I'm not liable for any of it. It worked this one time on my machine in a simulated environment. @@ -133,7 +133,7 @@ The template might look like::