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
9
votes
3 answers

Django/Haystack error: elasticsearch.exceptions.RequestError: TransportError(400, 'parsing_exception',...)

I am using elasticsearch as backend for haystack in my Django project. I created everything required for a search as mentioned here. But when i search i throws a traceback error with TransportError(400, 'parsing_exception', 'no [query] registered…
sumanth
  • 751
  • 2
  • 15
  • 34
9
votes
3 answers

Indexing/Searching "complex" JSON in elasticsearch

I have some JSON that looks like the following: Let's call that field metadata { "somekey1": "val1", "someotherkey2": "val2", "more_data": { "contains_more": [ { "foo": "val5", "bar": "val6" }, { …
scable
  • 4,064
  • 1
  • 27
  • 41
9
votes
2 answers

django-haystack: Failed to add documents to Solr: [Reason: Error 404 Not Found]

I'm using django-haystack (v 2.3.1) with solr (v 5.0.0) and pysolr (v 3.0.0). I've been following the tutorial, and have set up similar myapp/search_indexes.py and search/indexes/myapp/mymodel_text.txt files. ./manage.py build_solr_schema >…
gatlanticus
  • 1,158
  • 2
  • 14
  • 28
9
votes
3 answers

What is a good sample solrconfig.xml for django-haystack?

I am building out a solr instance for django, but the example provided from solr is super verbose, with many things that are not relevant to haystack. A sample with spelling suggestions, morelikethis, and faceting, without the extra stuff that…
Danner
  • 91
  • 2
9
votes
2 answers

Django, Haystack, Solr and Boosting

TLDR; How does various boosting types work together in django, django-haystack and solr? I am having trouble getting the most obvious search results to appear first. If I search for caring for others and get 10 results, The object with title caring…
Francis Yaconiello
  • 10,829
  • 2
  • 35
  • 54
8
votes
1 answer

haystack - how you display data from multiple models with ForeignKeys?

I have two models: models.py class model1 (models.Model): field1_model1 = models.CharField() filed2_model1 = models.CharField() class model2 (models.Model): field1_model2 = models.ForeignKey(model1) field2_model2 =…
avatar
  • 12,087
  • 17
  • 66
  • 82
8
votes
4 answers

Django-Haystack with Solr contains search

I am using haystack within a project using solr as the backend. I want to be able to perform a contains search, similar to the Django .filter(something__contains="...") The __startswith option does not suit our needs as it, as the name suggests,…
neolaser
  • 6,722
  • 18
  • 57
  • 90
8
votes
0 answers

Django Haystack - ElasticSearch result window too large

I've been working on a web app developed with Django which uses Postgres and ElasticSearch. It uses ElasticSearch since the database stores a lot of data which increases by the hour. To get things working quickly I used django-haystack 2.6.0 which…
8
votes
2 answers

Django - Haystack Query Serialization

I'm trying to serialize a HayStack SearchQuerySet: from django.core import serializers serializers.serialize("json", SearchQuerySet().filter(content=request.GET['q'])) but it throws: 'SearchQuery' object has no attribute '_build_query' How can I…
Alon Gubkin
  • 56,458
  • 54
  • 195
  • 288
8
votes
1 answer

How to filter haystack results with db query

I need to text-search across my model and filter with db queries at the same time. For example: class MyModel(models.Model): text = models.TextField() users = models.ManyToMany(User) class MyModelIndexIndex(indexes.SearchIndex,…
Nik
  • 420
  • 4
  • 16
8
votes
1 answer

No results in Django Haystack search

I've read the getting started documentation and several other examples on the web. And this is what my search_indexes.py looks like: from haystack.indexes import * from haystack import site from models import Entry class EntryIndex(SearchIndex): …
demux
  • 4,544
  • 2
  • 32
  • 56
8
votes
2 answers

Django-Haystack using Amazon Elasticsearch hosting with IAM credentials

I am hoping to use Amazon's Elasticsearch server to power a search of longtext fields in a Django database. However, I also don't want to expose this search to those who don't have a log in and don't want to rely on security through obscurity or…
8
votes
1 answer

Is it possible to disable django haystack for some tests?

We use django-haystack as our search index. Generally great, but during tests it adds overhead to every model object creation and save, and for most tests it is not required. So I would like to avoid it. So I thought I'd use override_settings to…
Hamish Downer
  • 16,603
  • 16
  • 90
  • 84
8
votes
1 answer

Django-haystack generic SearchView - no results

I'm tryinig to get haystack working with a class-based generic view according to the documentation here. I can get results from a SearchQuerySet in the shell, so the models are being indexed. But I can't get the view to return a result on the…
deixismou
  • 331
  • 2
  • 8
8
votes
1 answer

Serialize a django-haystack queryset

I want to export the results I have in a Queryset that I obtain from a haystack search view. In order to do this, I've found the best way is by doing it asyncronally, so I'm using Celery and Rabbitmq to manage the task and there create the file and…
Julian
  • 702
  • 4
  • 14
1 2
3
87 88