django-haystack

MapperParsingException on doing rebuild_index in django-haystack with elasticsearch

元气小坏坏 提交于 2019-12-22 10:55:05
问题 I'm using java 1.7.0_95 , Django 1.8.4 , Python 3.4.0 , Django Rest Framework 3.1.3 , ElasticSearch 2.3.1 , pyelasticsearch 1.4 and Django Haystack 2.4.1 I'm experiencing an error in elasticsearch every time I try to do python manage.py rebuild_index . This is the error: MapperParsingException[Root mapping definition has unsupported parameters: [_boost : {null_value=1.0, name=boost}]] at org.elasticsearch.index.mapper.DocumentMapperParser.checkNoRemainingFields(DocumentMapperParser.java:171)

Django Haystack/ElasticSearch indexing process aborted

拈花ヽ惹草 提交于 2019-12-22 09:30:55
问题 I'm running a setup with django 1.4, Haystack 2 beta, and ElasticSearch .20. My database is postgresql 9.1, which has several million records. When I try to index all of my data with haystack/elasticsearch, the process times out and I get a message that just says "Killed". So far I've noticed the following: I do get the number of documents to get indexed, so I'm not getting an error like, "0 documents to index". Indexing a small set, for example 1000, works just fine. I've tried hardcoding

Haystack queryset contains None elements

℡╲_俬逩灬. 提交于 2019-12-22 04:17:12
问题 I'm using Haystack for search, and the resulting SearchQuerySet returned contains None elements: >> SearchQuerySet().models(Question, Document, Idea) >> [<SearchResult: idea.idea (pk=3875)>, None, None, None] Running rebuild_index doesn't help. If I remove the .models() call from the first line, the problem goes away. I could just filter out None elements from the results, but I wanted to know if this is intended behaviour? I am using Django 1.4, Whoosh, and Haystack 2.0.0-beta 回答1: I had

Django Haystack indexing is not working for many to many field in model

我的未来我决定 提交于 2019-12-22 00:48:28
问题 I am using haystack in our django application for search and search is working very fine. But I am having an issue with reamtime search. For realtime search I am using haystack's default RealTimeSignalProcessor(haystack.signals.RealtimeSignalProcessor). My model contains one many to many field in it. When data is changed for this many to many field only, it seems the realtimesignal processor is not updating indexing data properly. After updating the many to many data, I am getting wrong

Django haystack doesn't add to Solr index. [Works with whoosh, fails with Solr]

一曲冷凌霜 提交于 2019-12-21 20:54:43
问题 During development I used whoosh as a backend, and now want to switch to solr. I installed solr, changed the settings, to HAYSTACK_SEARCH_ENGINE, and HAYSTACK_SOLR_URL. Now when I try to update or rebuild the index it fails with Failed to add documents to Solr: [Reason: None] . All searches are also wrong with 0 results returned for all queries.. This work if I change to whoosh. However, I have a RealTimeSearch index set, and during model creation I am getting no warning about not being able

Haystack - Why does RealtimeSearchIndex sometimes not update my saved object

我怕爱的太早我们不能终老 提交于 2019-12-21 03:53:27
问题 I'm using Haystack and Whoosh with Django Within search_index.py I have this class PageIndex(RealTimeSearchIndex): text = CharField(document=True, use_template=True) creator = CharField(model_attr='creator') created = DateTimeField(model_attr='created') org = CharField(model_attr='organisation') site.register(Page, PageIndex) My template looks like this {{ object.name }} {{ object.description }} {{ object.template|striptags }} {% for k,v in object.get_variables.items %} {{ v }} {% endfor %}

Django haystack EdgeNgramField given different results than elasticsearch

那年仲夏 提交于 2019-12-20 10:35:05
问题 I'm currently running haystack with an elasticsearch backend, and now I'm building an autocomplete for cities names. The problem is that SearchQuerySet is giving me different results, which from my perspective are wrong, than the same query executed directly in elasticsearch, which are for me the expected results. I'm using: Django 1.5.4, django-haystack 2.1.0, pyelasticsearch 0.6.1, elasticsearch 0.90.3 Using the following example data: Midfield Midland City Midway Minor Minturn Miami Beach

Which attribute of SearchQuerySet has the same function as prefetch_related?

坚强是说给别人听的谎言 提交于 2019-12-20 06:36:13
问题 def get_books_by_query_params(context, query, query_parameters): binding_query = query_parameters['binding_query'] query_parameters['validate']=1 default_query = None if query: default_queries = [ Q(title__icontains=query), Q(isbn_10__contains=query), Q(isbn_13__contains=query), Q(publishers=Publisher.objects.filter(name=query)), Q(institutes=Institute.objects.filter(name=query)), Q(authors=Author.objects.filter(name=query)), Q(sellers=Seller.objects.filter(name=query)) ] default_query =

Django Haystack Distinct Value for Field

本秂侑毒 提交于 2019-12-20 05:35:09
问题 I am building a small search engine using Django Haystack + Elasticsearch + Django REST Framework, and I'm trying to figure out reproduce the behavior of a Django QuerySet 's distinct method. My index looks something like this: class ItemIndex(indexes.SearchIndex, indexes.Indexable): text = indexes.CharField(document=True, use_template=True) item_id = indexes.IntegerField(faceted=True) def prepare_item_id(self, obj): return obj.item_id What I'd like to be able to do is the following: sqs =

Django: gettext raises ValueError: 'plural forms expression could be dangerous'

◇◆丶佛笑我妖孽 提交于 2019-12-19 03:24:15
问题 If a auto generated django.po file contains the following line in its header "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" "manage.py runserver" raises gettext.py", line 93, in c2py raise ValueError, 'plural forms expression could be dangerous' ValueError: plural forms expression could be dangerous If i remove the line everything works. What does the header mean? Why is it somtimes generated (for example localisation of the haystack app)? What das the error message mean? 回答1: It