You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-7Lines changed: 9 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,8 @@ This package lets you easily integrate the Algolia Search API to your [Django](h
11
11
12
12
You might be interested in this sample Django application providing a typeahead.js based auto-completion and Google-like instant search: [algoliasearch-django-example](https://github.com/algolia/algoliasearch-django-example)
13
13
14
+
Compatible with **Python 2.7**, **Python 3.3+** and **Django 1.7+**
By default, all the fields of your model will be used. You can configure the index by creating a subclass of `AlgoliaIndex`. A good place to do this is in a separate file, like `index.py`.
@@ -119,7 +121,7 @@ class YourModelIndex(AlgoliaIndex):
119
121
index_name ='my_index'
120
122
```
121
123
122
-
And then replace `register(YourModel)` with `register(YourModel, YourModelIndex)`.
124
+
And then replace `algoliasearch.register(YourModel)` with `algoliasearch.register(YourModel, YourModelIndex)`.
123
125
124
126
125
127
# Commands
@@ -145,7 +147,7 @@ We recommend the usage of our [JavaScript API Client](https://github.com/algolia
145
147
However, if you want to search from your backend you can use the `raw_search(YourModel, 'yourQuery', params)` method. It retrieves the raw JSON answer from the API.
146
148
147
149
```python
148
-
fromalgoliasearch_djangoimport raw_search
150
+
fromdjango.contrib.algoliasearchimport raw_search
149
151
150
152
params = { "hitsPerPage": 5 }
151
153
raw_search(Contact, "jim", params)
@@ -212,7 +214,7 @@ You can customize the index name. By default, the index name will be the name of
0 commit comments