Commit ff3d2da6f2570799dd4834a36e741880c0c849da
Exists in
master
and in
4 other branches
Merge pull request #115 from colab/haystack_search_doc
Update Search Documentation
Showing
1 changed file
with
17 additions
and
0 deletions
Show diff stats
docs/source/plugindev.rst
| ... | ... | @@ -145,3 +145,20 @@ the element will be displayed without a highlight. Therefore, in order to highli |
| 145 | 145 | to first check if there is a query search. If there is, use the tag "highlight" before the field name. However, it |
| 146 | 146 | must be said that the highlight tag should be followed by a complement, such as "with query", as can be seen on the example |
| 147 | 147 | above. This complement is used to allow the highlight only if the attribute is actually present on the query used to perform a search. |
| 148 | + | |
| 149 | +Also a another file that must be created is the search_index.py one. This file | |
| 150 | +must be placed at the plugin root directory. This file dictates how haystack | |
| 151 | +will index the plugins models. If there is any doubt about how to create this | |
| 152 | +file, it's possible to check the official haystack documentation that can be | |
| 153 | +seen on the bellow link. | |
| 154 | + | |
| 155 | +`Guide to create a SearchIndexesFiles`_ | |
| 156 | + | |
| 157 | +.. _`Guide to create a SearchIndexesFiles`: http://django-haystack.readthedocs.org/en/v2.4.0/tutorial.html#creating-searchindexes | |
| 158 | + | |
| 159 | +It can also be seen in the guide above that an indexes directory should be | |
| 160 | +created. This directory should be placed inside the search directory originally | |
| 161 | +created in this tutorial. Inside this directory, create a txt file for each | |
| 162 | +model that can be queried. Each of this files must contain the model fields that | |
| 163 | +will be search if no filter is applied. If there is any doubts to create these | |
| 164 | +files, please check the `Guide to create a SearchIndexesFiles`_. | ... | ... |