django-haystack

django haystack autocomplete with bootstrap

你离开我真会死。 提交于 2019-12-11 19:35:52
问题 I'm trying to make django Haystack autocomplete work. Finally I made it work but it doesn't show-up properly. I used haystack autocomplete example. I got data generated from db and printed on website. But bootstrap won't show them properly. I think I should change html tags to show them properly. This is how it looks like now: Header gets enlarged accoding to number of autocomplete fields. This is its html: <div class="ac-results"> <div class="result-wrapper"> <a class="ac-result" href="

Get results from two models in Haystack/whoosh

做~自己de王妃 提交于 2019-12-11 18:08:05
问题 I used Haystack with on model and it worked just fine. But when I tried to use two models, it keeps returning None. These are my models: class People(models.Model): name = models.CharField(max_length=100) description = models.TextField() def __unicode__(self): return self.name class Note(models.Model): user = models.ForeignKey(CustomUser) title = models.CharField(max_length=200) body = models.TextField() pub_date = models.DateTimeField() def __unicode__(self): return self.title These are the

Configure ElasticSearch to use ngram by default. - SQL LIKE %% behavior

为君一笑 提交于 2019-12-11 16:49:26
问题 Is it possible to configure the elasticsearch index behavior to ack as the LIKE keyword of SQL. If the index contains "This document is called MySuperInvoice", I want to be able to find it if I am looking for super, doc or voice" Thank you for your help. Edit: Somebody tells me that I need to put * around my search terms : *query* Lets see how this can be done using haystack. 回答1: Ok I finally got there. Thanks @zebuline. cluster: name: webapp network: bind_host: 0.0.0.0 publish_host: _eth0_

Django-cms haystack search - placeholder content

不想你离开。 提交于 2019-12-11 16:39:18
问题 i have problem with results in django-cms and haystack search. I'm using django-cms-search plugin, haystack as backend. Haystack returns correct results. But i want to show "teaser" in search results. I can access absolute URL and title of page via template this way: {% for result in page.object_list %} <div class="searchResults"> <h2>{{ result.object.get_title }}</h2> {{ result.object.placeholders.all }} <p><a href="{{ result.object.get_absolute_url }}">{% blocktrans %} Read more {%

How to return only indexed objects of a specific type in Haystack

╄→гoц情女王★ 提交于 2019-12-11 12:41:41
问题 Is there any way to use SearchQuerySet and restrict the results to only a specific indexed model? i.e. If i add Note and NoteIndex to Haystack, can I pull out just results that correspond to Note instances? EDIT: I have had a look and found that there is a reserved field named django_ct that is stored on every indexed model. Is it possible to filter on this field? What values does it take? DOUBLE EDIT: Nevermind. After reading the Haystack source code, django_ct is 'appname.modelname'

Django haystack with Elasticsearch cannot find database when rebuilding index

ぐ巨炮叔叔 提交于 2019-12-11 12:15:47
问题 I added Haystack to a Django project that was already succesfully deployed to an AWS ElasticBeanstalk instance. Haystack is working locally but in the AWS environment when I run rebuild_index . I get this error: Failed to clear Elasticsearch index: ConnectionError(('Connection aborted.', error(111, 'Connection refused'))) caused by: ProtocolError(('Connection aborted.', error(111, 'Connection refused'))) All documents removed. ERROR:root:Error updating api using default Traceback (most recent

How do I add related data to a haystack model index?

ぐ巨炮叔叔 提交于 2019-12-11 08:02:09
问题 I have added haystack search to my fledgling django app and managed to create an index for a model, using the template feature. For some reason I am having trouble adding related data to this template index. I am trying the following: {{object.name}} {% for tag in object.tags.all %} {{tag.name}} {% endfor %} The indexes are added correctly and I get search results on the object.name property, but not on the related tags. I have verified that the relationships are correct by using the same

index analyzer vs query analyzer in haystack - elasticsearch?

独自空忆成欢 提交于 2019-12-11 07:58:50
问题 Elasticsearch itself seems to support index-analyzer and query-analyzer, but haystack's elasticsearch doesn't seem to differentiate them. Am I Correct? related question is, Elasticsearch's DEFAULT_SETTING seems to have 'settings.analysis.anaylyzer' and 'index.analysys.anaylyzer'. (eg. http://www.wellfireinteractive.com/blog/custom-haystack-elasticsearch-backend/ has 'index') What's the difference between them? 回答1: With haystack, you want to set the mappings yourself. I wrote about haystack

Django Haystack - A SearchIndex Based on Multiple Models

梦想的初衷 提交于 2019-12-11 05:27:32
问题 I have some problems by trying to create my SearchIndex with Haystack on Django and I don't know what to do. Here are my two models : # Meta: stores meta data about tutorials (category, title) class Meta(models.Model): """ Database [tutorial.meta] """ mta_title = models.CharField(max_length=TUTORIAL_TITLE_MAX) mta_views = models.PositiveIntegerField(default=0) # Contents: stores the tutorial text content class Contents(models.Model): """ Database [tutorial.contents] """ tut_id = IdField() cnt

no result are found - haystack django whoosh

半城伤御伤魂 提交于 2019-12-11 04:03:38
问题 I have a huge problem! I am using haystack and whoosh and django. I am sure I've done everything that is required to be done to make it works according to the documentation. BUT!!!! results of searching are: "no results found" all the time. But if symbols I put into the form are spaces, every objects I've indexed are printed Details: In my search_indexes.py I have: from haystack.indexes import * from haystack import site from aias.models import Uspd class UspdIndex(SearchIndex): text =