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

A little confused about rebuild/update_index for Django-Haystack

I deleted a record from django app, then I followed it up with up with update_index and the record was still searchable. I then used rebuild_index and that seemed to work when I ran the search again. But I do not know if my computer stuttered or…
losee
  • 2,190
  • 3
  • 29
  • 55
6
votes
2 answers

Django haystack, How to search for a ManyToMany related field?

I've added a MultivaluedField to my index (haystack), I need to search for a ManyToMany related field, but it doesn't work. The engine is WHOOSH. This how my index looks like: class PostIndex(SearchIndex): text = CharField(document=True,…
Félix
  • 579
  • 4
  • 21
6
votes
3 answers

How to parse "2015-01-01T00:00:00Z" in Django Template?

In my Django html template, I get my SOLR facet_date result using haystack in the format "2015-01-01T00:00:00Z". How can I parse it in format "01/01/2015" in my template? My template is {{ facets.dates.created.start }} What "|date:" option should…
MC X
  • 337
  • 4
  • 16
6
votes
1 answer

How to add individual objects to django haystack?

I have a search index that I have created using Solr. I want to add individual django objects to the search index. To remove objects from the solr database we use remove_object. some = SomFooModel.objects.get(pk=1) foo =…
Akash Deshpande
  • 2,583
  • 10
  • 41
  • 82
6
votes
1 answer

Fields in apache solr response are multivalued when they should be singular

I'm experiencing a problem with Apache Solr where I'm receiving fields wrapped in lists in JSON responses but they should be singular. Here is an exerpt from schema.xml, two example fields giving me a problem are django_ct and django_id:
Isaac
  • 1,371
  • 3
  • 14
  • 36
6
votes
1 answer

using elastic-search as database in django

I want to use elastic-search as database in my project which I build on django framework. As I learn, elastic search is used with together a database through haystack where elastic-search is used for only indexing and fast retrieval issues. Here it…
mustafa.yavuz
  • 1,274
  • 2
  • 21
  • 40
6
votes
2 answers

How to index a foreign key CharField using Haystack/Whoosh with Django?

Using prepare_FOO(self, object) method, I'm trying to index a ForeignKey to get the name attribute of my tags (travel, family, ...) This is my model class Blog(models.Model): title = models.CharField(max_length=500) description =…
Pompeyo
  • 1,459
  • 3
  • 18
  • 42
6
votes
1 answer

filtering for multiple values in a MultiValueField in Django Haystack

I've got two models like below. The permission structure allows a Person to see any object that has a Group in common with them, so that if a Person is in Groups 1, 2, and 3, and an Object is shared with Groups 3, 4, 5, the Person can see it through…
mrooney
  • 1,994
  • 2
  • 19
  • 30
6
votes
1 answer

Does not work autocomplete with EdgeNgramField using haystack and engine Elasticsearch (Django)

I need to search substring values in a model field. I have an Index and a SearchQuerySet. This is the Elasticsearch configuration. HAYSTACK_CONNECTIONS = { 'default': { 'ENGINE':…
Juan
  • 63
  • 6
6
votes
2 answers

Django Haystack - How to filter search results by a boolean field?

Trying to filter a SearchQuerySet by a boolean value doesn't work for me. (I am using the provided "Simple" backend search engine while testing.) I have an index like: class MyIndex(indexes.SearchIndex, indexes.Indexable): text =…
Goluxas
  • 177
  • 3
  • 8
6
votes
1 answer

Django, Haystack, Solr, MongoDB architecture decision

I'm building a log viewing utility which will handle real-time search in TBs of logs. I have decided to store logs in Solr and use it as search engine.I will use Django as framework in my project. In order to use Solr with Django I saw there is…
denizeren
  • 934
  • 8
  • 20
6
votes
4 answers

Django haystack SearchQuerySet to QuerySet

I have a very generic view/template to display the contents of a queryset of a given model. I use from 12 places with 12 different querysets, now I wanted to integrate the haystack search in there but I can't because SearchQuerySet does not match a…
Sala
  • 61
  • 1
  • 2
6
votes
2 answers

ElasticSearch: EdgeNgrams and Numbers

Any ideas on how EdgeNgram treats numbers? I'm running haystack with an ElasticSearch backend. I created an indexed field of type EdgeNgram. This field will contain a string that may contain words as well as numbers. When I run a search against…
ComoWhat
  • 105
  • 1
  • 4
6
votes
1 answer

django haystack SearchField with indexed False

Is there any reason to set additional fields with indexed=False into SearchIndex? Documentation mentioned that additional fields should be defined for filtering or ordering results. By default SearchIndex has indexed=True, so what happens if I set…
Fibio
  • 151
  • 3
6
votes
2 answers

Django Haystack autocompletion on two (multiple) fields

I use haystack 1.2.6 with Whoosh 2.4 and Django 1.3. Let's say that we have the below model describing an hypothetical post. Post(models.Model): title = models.CharField() body = models.TextField() We built our post index like this for…
geros
  • 97
  • 9