Questions tagged [django-haystack]

Haystack is a modular search app for Django projects. It aims to provide a familiar API for django developers that does not depend on the backend used for searching.

Haystack gives django developers a familiar API to write search code and use it with any supported search engine (as of this writing those are Solr, Whoosh, ElasticSearch and Xapian). It also provides basic views and forms necessary for building the search infrastructure into your project in a way that is extensible and doesn't require modifications in other apps.

It provide advanced features like

  • Highlighting
  • Faceting
  • Autocomplete
  • Boost
  • Signal Processors
  • Multiple Indexes
  • Rich Content Extraction
  • Spatial Search
1312 questions
7
votes
3 answers

Error: The 'elasticsearch' backend requires the installation of 'requests'. How do I fix it?

I´m having a issue when I ran "python manage.py rebuild_index" in my app supported by haystack and elasticsearch. Python 2.7 Django version 1.6.2 Haystack 2.1.0 Elasticsearch 1.0 Please see the error that is appearing: Traceback (most recent call…
ultraInstinct
  • 4,063
  • 10
  • 36
  • 53
7
votes
2 answers

Django Haystack - Filter by substring of a field using SearchQuerySet ()

I have a Django project that uses SOLR for indexing. I'm trying to do a substring search using Haystack's SearchQuerySet class. For example, when a user searches for the term "ear", it should return the entry that has a field with the value:…
Nahn
  • 3,196
  • 1
  • 24
  • 23
7
votes
1 answer

Searching in several tables with django-haystack

I've got the Restaurant and Comment models shown below. The Comment model has a ForeignKey to Restaurant. How can I perform a search in some of the Restaurant fields and in the comment field of the Comment model which returns a list of Restaurant…
jul
  • 721
  • 1
  • 9
  • 18
7
votes
1 answer

Haystack search on a many to many field is not working

I'm trying to run a search on a model that has a many to many field, and I want to filter the search using this field. here is my current code: search_indexes.py class ListingInex(indexes.SearchIndex, indexes.Indexable): text =…
camara90100
  • 852
  • 2
  • 10
  • 18
7
votes
1 answer

how to resolve circular import involving haystack?

Haystack haystack_signal_processor let you use custom signal processor to initiate index for certain models. I have in my settings.py HAYSTACK_SIGNAL_PROCESSOR='my_app.signals.MySignalProcessor' (this imports signals.py so. this is settings ->…
eugene
  • 39,839
  • 68
  • 255
  • 489
7
votes
2 answers

How to make an abstract Haystack SearchIndex class

How do you make an abstract SearchIndex class, similar to how Django lets you make abstract base models? I have several SearchIndexes that I'd like to give the same basic fields (object_id, timestamp, importance, etc). Currently, I'm duplicating all…
Cerin
  • 60,957
  • 96
  • 316
  • 522
7
votes
0 answers

Boosting with Haystack + Elasticsearch

I implemented a boost on my 'tags' field; however it doesn't rank my results in the appropriate way. my search_indexes.py: class ParagraphIndex(indexes.SearchIndex, indexes.Indexable): text= indexes.CharField(document=True, use_template=True,…
Badi8beach
  • 556
  • 2
  • 4
  • 18
7
votes
3 answers

Django-haystack: rebuild_index fails (haystack.exceptions.SearchFieldError) after adding `content_auto` line needed for autocomplete

I'm trying to implement yielding results for a searching only a part of a word (which is called autocomplete according to the Haystack docs if I'm not mistaken). Example: Search "gol" Result "goldfish" What have I tried? I did as asked in step 1 of…
Bentley4
  • 10,678
  • 25
  • 83
  • 134
7
votes
2 answers

IndexMissingException - django haystack with elasticsearch

I am trying to setup haystack search with elasticsearch backend I am receiving the following error: ./manage.py rebuild_index ... Failed to clear Elasticsearch index: (404, u'IndexMissingException[[haystack] missing]') However, the following…
phlebas
  • 1,210
  • 2
  • 13
  • 24
6
votes
2 answers

Django Haystack - How to boost a field?

I'm with some problems in Django Haystack 1.2.5. I need to boost one field but aparently it is not working. I'm using Solr 1.4.1. My Index: class JobsTextIndex(indexes.SearchIndex): text = indexes.CharField(document=True,…
André
  • 24,706
  • 43
  • 121
  • 178
6
votes
4 answers

Django : Cannot Import name xrange

I am new to python and django. I had django running properly in my machine, till I installed django-haystack. I directly downloaded django-haystack.zip from github and executed 'python setup.py install' in haystack dir. After this whenever I run…
avis
  • 599
  • 1
  • 6
  • 18
6
votes
1 answer

Django pass Haystack highlighter result to a view

I am using django-haystack and I am trying to implement a way to append the page number to a pdf link in order to open it in the specific page. My goal is to open the pdf in the page where the first hit is found. I know the position of the hit in my…
mnmbs
  • 353
  • 3
  • 13
6
votes
1 answer

Django elasticsearch transport error no query found

I followed tutorial on: http://krzysztofzuraw.com/blog/2016/haystack-elasticsearch-part-two.html http://www.techstricks.com/django-haystack-and-elasticsearch-tutorial/ Everything works fine but when i try to query something from the search box it…
Al-Alamin
  • 1,438
  • 2
  • 15
  • 34
6
votes
1 answer

Iterating over items in a search result view with Django haystack MultiValueField

If I have a MultiValueField on one of my search indexes, and I want to display each value in the search results, how would I do that? It seems like something is not being formatted appropriately or I am somehow misunderstanding the…
nyxtom
  • 2,919
  • 2
  • 23
  • 24
6
votes
3 answers

Unable to rebuild_index elasticsearch with Django Haystack: 'Connection refused'

I'm facing a strange issue, using Django Haystack and ElasticSearch, preventing me from indexing content. ElasticSearch is properly running on the machine: # curl -X GET 127.0.0.1:9200 { "status" : 200, "name" : "White Pilgrim", "cluster_name"…
user650108
  • 1,009
  • 1
  • 9
  • 18