django-haystack

Django-Haystack-Whoosh is giving no results

回眸只為那壹抹淺笑 提交于 2019-12-24 08:48:26
问题 I'm trying to use Haystack-Whoosh for search in a Django application. I've implemented code same as mentioned in documentation page: django-haystack documentaation but still it is not working no search results were filtered. Here is my code: models.py from django.db import models from datetime import datetime class Newcar(models.Model): car_name = models.CharField(max_length=50) carmodel = models.CharField(max_length=50) car_logo = models.CharField(max_length=1000) pub_date = models

Stable Django-Haystack + elasticsearch setup

淺唱寂寞╮ 提交于 2019-12-24 00:39:51
问题 I'm wondering what the best combination of Django-Haystack + elasticsearch + pyelasticsearch/elasticsearch-py is. I've deployed a setup using Haystack 2.1.1-dev + elasticsearch 1.1.1 + elasticsearch-py 1.0 on an Ubuntu 12.04 machine. I tried using Haystack 2.1.0 (latest stable release) with elasticsearch 1.1.1 and pyelasticsearch 0.6.1, but it kept throwing me an error saying Django-Haystack depends on pyelasticsearch; so I switched to 2.1.1-dev, which worked beautifully. But now I'm trying

EdgeNgramField min and max letters in django haystack

£可爱£侵袭症+ 提交于 2019-12-23 10:53:11
问题 Is there a way to restrict the size of the edge ngrams in django haystack indexing? For example, I create the ngram as follows: #search_indexes.py content_auto = indexes.EdgeNgramField(model_attr='name') But I don't want to create 2 letter ngrams, I actually want to set the min at 4 or 5. As background, I am using django-haystack/elasticsearch, with bonsai on heroku. 回答1: What you need to do is override the search mapping in Haystack's ElasticSearch backend. In brief: extend the ElasticSearch

filtering for multiple values in a MultiValueField in Django Haystack

扶醉桌前 提交于 2019-12-23 09:31:03
问题 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 Group 3. class Person(models.Model): groups = models.ManyToManyField(Group) class Object(models.Model): groups = models.ManyToManyField(Group) The SearchIndex is like this: class ObjectIndex(indexes.SearchIndex, indexes.Indexable): groups =

Solr authentication (using Django Haystack)

主宰稳场 提交于 2019-12-23 03:24:10
问题 My solr service works without HTTP authentication, but my webhost provides it and I'd like to take advantage of it. I've been given a username and password to access my solr service by dotcloud in the form of a url: 'http://dotcloud:XXXXXXXXXXXXXXXXXXXX@gigsmash-teamfoobar.dotcloud.com/solr/' When I point my browser to this address, it works just fine. In my settings.py file I have the following line: HAYSTACK_SOLR_URL = 'http://dotcloud:XXXXXXXXXXXXXXXXXXX@gigsmash-teamfoobar.dotcloud.com

Django 1.9/Haystack 2.4.1 “Model could not be found for SearchResult”

感情迁移 提交于 2019-12-23 02:01:31
问题 Let me just first say, I have tried the fixes here: Haystack says “Model could not be found for SearchResult” and I'm still getting Model could not be found for SearchResult '<SearchResult: dictionary.termentry (pk=u'10')>'. I'm on Django 1.9 & Haystack 2.4.1 with Whoosh. I've determined that the SearchQuerySet is filtering just fine (when I print queryset I get a list of SearchResult objects). I didn't touch anything beyond the SearchIndex definitions, so this is out-of-the-box stuff. Just

Django 1.9/Haystack 2.4.1 “Model could not be found for SearchResult”

杀马特。学长 韩版系。学妹 提交于 2019-12-23 02:01:27
问题 Let me just first say, I have tried the fixes here: Haystack says “Model could not be found for SearchResult” and I'm still getting Model could not be found for SearchResult '<SearchResult: dictionary.termentry (pk=u'10')>'. I'm on Django 1.9 & Haystack 2.4.1 with Whoosh. I've determined that the SearchQuerySet is filtering just fine (when I print queryset I get a list of SearchResult objects). I didn't touch anything beyond the SearchIndex definitions, so this is out-of-the-box stuff. Just

Haystack more_like_this returns all

一笑奈何 提交于 2019-12-22 21:56:00
问题 I am using Django, haystack, solr, to do searching. Ive am able to search and now I would like to find similar items using more_like_this. When I try to use the more_like_this functionality I get back all of the objects that are of that model type instead of just the ones that closely match it. Here is some code to show you how I am using it: def resource_view(request, slug): resource = Resource.objects.get(slug=slug) versions = Version.objects.get_for_object(resource) related =

Haystack more_like_this returns all

亡梦爱人 提交于 2019-12-22 21:55:44
问题 I am using Django, haystack, solr, to do searching. Ive am able to search and now I would like to find similar items using more_like_this. When I try to use the more_like_this functionality I get back all of the objects that are of that model type instead of just the ones that closely match it. Here is some code to show you how I am using it: def resource_view(request, slug): resource = Resource.objects.get(slug=slug) versions = Version.objects.get_for_object(resource) related =

Multiple Cores in Django Haystack using Solr Backend

时光总嘲笑我的痴心妄想 提交于 2019-12-22 17:59:43
问题 How do I configure HAYSTACK_SOLR_URL when using multiple cores? I've set it to the address of core0, and that works, but only using one core… The docs aren't that obvious to me… it just says ... # ...or for multicore... HAYSTACK_SOLR_URL = 'http://127.0.0.1:8983/solr/mysite' What is mysite? I'm actually running apache-solar-3.3.0/example with the multicore directory copied over the example directory, and the schema and conf files/directories updated. Many thanks. 回答1: <cores adminPath="/admin