django-cms-search
django-cms-search copied to clipboard
Customize PageIndex
Which way would you recommend to customize the page index created by cms_search? I'd like for example to set the text field to EdgeNgramField or make the title field indexable.
Hi,
as far as I can tell, this is not really in scope of django-cms-search. You'll probably have to look at haystack for this (e.g. https://groups.google.com/forum/?fromgroups#!topic/django-haystack/j6f-z_-XQWE)
Kind regards, Benjamin
BTW: this is not really the place to get support, but to report issues and feature requests.
Hi,
thank you for the quick reply! Well, the issue I'm having with django-cms-search is that only whole words are found in the index but not word parts. Autocompletion is also impossible. The quick and dirty solution is to change line 56 in search_indexes.py to
text = indexes.EdgeNgramField(document=True, use_template=False)
instead of
text = indexes.CharField(document=True, use_template=False)
but I'm looking for a better one. Like for example supplying an own base class for index and doing some magic in prepare()
. Thought you have one in mind. If not I would like to request (and help to implement) such feature. For example make an option for supplying a custom page_index_factory.
Regards Alexey
Ah, got you. I guess we could move the field definitions into a configurable base class.