django-haystack

Drill down the haystack search results with facets but not changing the facet results

血红的双手。 提交于 2019-12-04 16:46:19
I have search results showing with facet options for drilling down the data. When a facet is selected it then changes the facet results. So if I am originally showing "places (10)", "images (5)", "people (3)", and "All (18)" as faceting options and I click on images I would still like to see all the others too even though the search results changed. Is there a good way to do this? I've run into problems with this too. The only answer we could find was to re-run the query each time without the drill-down to get the top-level facet results. I just did this and it's actually quite achievable

haystack multiple field search

喜夏-厌秋 提交于 2019-12-04 12:39:23
Hi i m using haystack with a woosh as search engine: my model looks as follows class Person(models.Model): personid = models.IntegerField(primary_key = True, db_column = 'PID') firstname = models.CharField(max_length = 50, db_column = 'FIRSTNAME') lastname = models.CharField(max_length = 50, db_column = 'LASTNAME') class Meta: db_table = '"TEST"."PERSON"' managed = False class TDoc(models.Model): tdocid = models.IntegerField(primary_key = True, db_column = 'TDOCID') person = models.ForeignKey(Person, db_column = 'PID') content = models.TextField(db_column = 'CONTENT', blank = True) filepath =

Django-Haystack using Amazon Elasticsearch hosting with IAM credentials

人盡茶涼 提交于 2019-12-04 11:26:40
问题 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 some IP restriction tactic (unless it would work well with an existing heroku app, where the Django app is deployed). Haystack seems to go a long way toward this, but there doesn't seem to be an easy way to configure it to use Amazon's IAM credentials

Django Haystack - Show results without needing a search query?

穿精又带淫゛_ 提交于 2019-12-04 11:24:46
问题 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 return any values if a search query is not specified. Any ideas how I can get around it? Thanks! 回答1: If anyone is still looking, there's a simple solution suggested in haystack code: https://github.com/toastdriven/django-haystack/blob/master

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

我与影子孤独终老i 提交于 2019-12-04 06:49:53
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 last): File "manage.py", line 10, in execute_from_command_line(sys.argv) File "/usr/lib/python2.7/site-packages/django/core/management/ init .py", line 399, in > execute_from_command_line utility.execute() File "/usr/lib/python2.7/site-packages/django/core/management/ init .py", line 392, in > execute self.fetch_command(subcommand).run_from_argv(self

Django - Strange behavior using static files

泄露秘密 提交于 2019-12-04 06:15:29
问题 I'm new to Django. I'm getting insane trying to understand what is going on with static files(css's and images). The resume of the problem is the following... when I use static views from a 3rd party App(Haystack) I can't use static files. My project have this directory structure: 1001empbr (name of the folder for the project) | |------ 1001emp (name of the django project) | |------ 1001empbr (name of my App) |------ site_media (folder with static files CSS/JPG/GIF) |------ templates (folder

AttributeError: 'ElasticSearch' object has no attribute 'bulk_index'"

孤人 提交于 2019-12-04 05:13:10
问题 When I try python manage.py rebuild_index , error occur: self.conn.bulk_index(self.index_name, 'modelresult', prepped_docs, id_field=ID) AttributeError: 'ElasticSearch' object has no attribute 'bulk_index' I found the link https://github.com/toastdriven/pyelasticsearch/blob/master/pyelasticsearch.py#L424-469 with pyelasticsearch.py, and I dont know which edition it is. Anyway there is bulk_index in that code, buy my pyelasticsearch.py is not. Anyone has the same experience? thanks for ur time

Search over multiple fields

孤者浪人 提交于 2019-12-03 21:23:50
I think I don't unterstand django-haystack properly: I have a data model containing several fields, and I would to have two of them searched: class UserProfile(models.Model): user = models.ForeignKey(User, unique=True, default=None) twitter_account = models.CharField(max_length=50, blank=False) My search index settings: class UserProfileIndex(SearchIndex): text = CharField(document=True, model_attr='user') twitter_account = CharField(model_attr='twitter_account') def get_queryset(self): """Used when the entire index for model is updated.""" return UserProfile.objects.all() But when I perform a

Can't get Elasticsearch working with Django

旧街凉风 提交于 2019-12-03 20:25:22
问题 I'm trying to use Django and Haystack with Elasticsearch as the backend on Ubuntu 14.04. I have Elasticsearch and Haystack installed. The error I receive when I run python manage.py runserver: me@ubuntu:$ python manage.py runserver Validating models... 0 errors found January 31, 2015 - 17:40:37 Django version 1.5.4, using settings 'website_project.settings' Development server is running at http://127.0.0.1:8000/ Quit the server with CONTROL-C. Traceback (most recent call last): File "/home/me

Django-haystack full text search working but facets don't

安稳与你 提交于 2019-12-03 17:07:09
Using django-haystack and elasticsearch. Full text search is working ok, but I have trouble to implement facets. I've searched tutorial on web but with no success, in other words didn't understand any of them. I am beginner in programing, so some help it will be appreciated. Thank you in advance. Sorry on my english if isn't good, it isn't my primary language. Here is my working full text search. articles.models.py class Article(models.Model): category = models.CharField(max_length=60) subcategory = models.CharField(max_length=100) name = models.CharField(max_length=255) price = models