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
12
votes
1 answer

Django Haystack: filter query based on multiple items in a list.

I have Event model instances that can belong to one or more Organization model instances. I've implemented haystack 2.0.0 to index all of my Events. Here is an example search index. class EventIndex(indexes.SearchIndex, indexes.Indexable): …
Joe J
  • 9,985
  • 16
  • 68
  • 100
12
votes
1 answer

Integrating django-haystack with django-rest-framework?

I would like to know, how I could use django-rest-framework to provide a paginated json result from a get request q=thisterm. I understand the haystack end of things using SearchQuerySet.filter(content=q) however how do I serialize and create an api…
Deep
  • 2,988
  • 4
  • 34
  • 44
12
votes
3 answers

Filter Django Haystack results like QuerySet?

Is it possible to combine a Django Haystack search with "built-in" QuerySet filter operations, specifically filtering with Q() instances and lookup types not supported by SearchQuerySet? In either order: haystack-searched ->…
nikola
  • 2,241
  • 4
  • 30
  • 42
12
votes
3 answers

How can I filter a Haystack SearchQuerySet for None on an IntegerField

This is driving me a bit mad but seems like it should be simple. I'm using Django and Haystack and have a search index including an IntegerField which allows null. This is based on a related model in Django, but I don't think this matters. eg: class…
Ludo
  • 2,739
  • 2
  • 28
  • 42
12
votes
5 answers

how to filter search by values that are not available

I have a list of items as: i = SearchQuerySet().models(Item) now, each item in i has a attribute, price I want to narrow the result in which price information is not available along with the ones falling in a given range something…
user2404546
11
votes
4 answers

Haystack - Why does RealtimeSearchIndex sometimes not update my saved object

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 =…
frank stallone
  • 301
  • 4
  • 7
11
votes
4 answers

elasticsearch exceptions ConnectionError

I am making a Django app. It uses Haystack with elasticsearch as backend. When I run ./manage.py rebuild_index I get this error: aborted.', error(61, 'Connection refused'))) caused by: ProtocolError(('Connection aborted.', error(61,…
Deepti
  • 576
  • 2
  • 5
  • 15
11
votes
1 answer

How can I do a fuzzy search using django-haystack and the elasticsearch backend?

It looks as if elasticsearch supports fuzzy queries (http://www.elasticsearch.org/guide/reference/query-dsl/fuzzy-query/) but I can't figure out a way to have django-haystack pass in that option. I dug into the django-haystack search and it looks as…
Dan Goldin
  • 957
  • 13
  • 32
11
votes
1 answer

Haystack search results: how to use different templates for different models in page.object_list?

I'm adding search to an existing Django site, using Haystack with a Solr backend. I want my search to work across several different models, and return a single set of of results. When iterating through the results, I would like to format each…
Cashman
  • 301
  • 2
  • 8
10
votes
3 answers

Count total search objects count in template using django-haystack

I am using django haystack with xapian as the backend search engine. I am using FacetedSearchView and FacetedSearchForm for faceting over the search. I have passed searchqueryset to the FacetSearchView in my urls.py file. But the problem is I…
tejinderss
  • 1,612
  • 17
  • 20
10
votes
2 answers

django-haystack ordering - How do I handle this?

I'm using django-haystack for a search page on my site. I'm basically done, but not quite happy with the ordering and not quite sure how haystack decides how to order everything. I know I can over-ride the SearchQuerySet by using order_by but that…
Bartek
  • 15,269
  • 2
  • 58
  • 65
10
votes
5 answers

Solr can't find resource stopwords_en.txt

I'm trying to setup Solr 3.6.0 with Django-haystack Beta 2.0.0. After running ./manage.py build_solr_schema and moving schema.xml to the conf directory, upon visiting http://localhost:8983/solr/admin, I receive an error exactly like the one produced…
Randall Ma
  • 10,486
  • 9
  • 37
  • 45
10
votes
5 answers

Django Haystack - Show results without needing a search query?

I would like to display all results which match selected facets even though a search query has not been inserted. Similar to how some shop applications work e.g. Amazon e.g. Show all products which are "blue" and between $10-$100. Haystack does not…
RadiantHex
  • 24,907
  • 47
  • 148
  • 244
9
votes
2 answers

solr + haystack + django where do I place schema.xml?

I just installed Solr and Haystack for a Django project I'm working on. Following this Haystack tutorial I created a schema.xml but I'm not sure where to place it in the Solr installation. My Solr installation is in a directory like this: /solr and…
avatar
  • 12,087
  • 17
  • 66
  • 82
9
votes
1 answer

Indexing and searching related objects with haystack

I'm pretty new to search implementation, bear with me while I'm learning! So my pet project is a recipe site and each recipe can have n steps. the model looks something like: class Recipe(models.Model): title = models.CharField(max_length=255) …
dengar81
  • 2,485
  • 3
  • 18
  • 23
1
2
3
87 88