django-haystack

haystack multiple field search

主宰稳场 提交于 2019-12-06 08:04:39
问题 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

Multiple Cores in Django Haystack using Solr Backend

家住魔仙堡 提交于 2019-12-06 07:46:17
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. <cores adminPath="/admin/cores"> <core name="core0" instanceDir="core0" /> <core name="core1" instanceDir="core1" /> </cores> So,

Django Haystack Faceting examples

亡梦爱人 提交于 2019-12-06 06:28:02
I want to use Django-Haystack-Solr in a site I am working on. I have worked through the examples in the Haystack documentation and have searched the internet extensively for other examples. I am having difficulty making the leap to integrating it in my site. I found http://www.slideshare.net/Nagyman/faceted-navigation-using-django-haystack-and-solr interesting, but fell short of how to pull it all together. If anyone has run across some "robust" Haystack faceting examples, websites that are open-source, or would be willing to share some of your own code please provide links/share code. Thanks

Haystack: one searchIndex for multiple models

帅比萌擦擦* 提交于 2019-12-06 05:37:22
On the getting started page of Haystack, it describes the possibility of using one SearchIndex for multple models: You generally create a unique SearchIndex for each type of Model you wish to index, though you can reuse the same SearchIndex between different models if you take care in doing so and your field names are very standardized. However I haven't found any information regarding how to do so. The reasoning behind it is that a few Heroku search engine apps provide limited amount of indices, so I think it's a good idea to keep the number of indices slim. How should I do it? No of index

ignore accents in elastic search with haystack

十年热恋 提交于 2019-12-06 05:36:05
I am using elasticsearch along with haystack in order to provide search. I want user to search in language other than english. E.g. currently trying with Greek. How can I ignore the accents while searching for anything. E.g. let's say if I enter Ανδρέας ( with accents), its returning results matched with it. But when I enter Ανδρεας, its not returning any results. The search engine should bring any results that have "Ανδρέας" but also "Ανδρεας" as well (the second one is not accented). Can someone point out how to resolve the issue? Please let me know if I need post settings for elastic search

django haystack how do I find substrings in words?

落爺英雄遲暮 提交于 2019-12-06 04:09:50
In my field the content is "example". I want to find not only the exact word "example", I also want to find "examp". How can I do that? Are there any options. Can't find anything. jasisz If you just want to search for objects starting with some string, then just look at Haystack SearchQuerySet API documentation. It resembles the Django QuerySet API, so it is possible to write: SearchQuerySet().filter(content__startswith='examp') SearchQuerySet().filter(content__contains='examp') or whatever you want. But there is also something deeper in this question. I don't think you really need to. Because

Django 2.0 haystack whoosh update index, rebuild index throw error

筅森魡賤 提交于 2019-12-06 03:25:35
I am using django 2.0 with haystack+whoosh as a search. I configured as it is said in the documentation. Occurred problem is when i run ./manage.py rebuild_index it shows this error: Traceback (most recent call last): File "./manage.py", line 15, in <module> execute_from_command_line(sys.argv) File "/home/zorig/.virtualenvs/ftm/lib/python3.5/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line utility.execute() File "/home/zorig/.virtualenvs/ftm/lib/python3.5/site-packages/django/core/management/__init__.py", line 365, in execute self.fetch_command

Using django haystack autocomplete with elasticsearch to search for digits/numbers?

淺唱寂寞╮ 提交于 2019-12-06 02:02:00
I'm using Django Haystack backed by Elasticsearch for autocomplete, and I'm having trouble searching for digits in a field. For example, I have a field called 'name' on an object type that has some values like this: ['NAME', 'NAME2', 'NAME7', 'ANOTHER NAME 8', '7342', 'SOMETHING ELSE', 'LAST ONE 7'] and I'd like to use autocomplete to search for all objects with the number '7' in the name. I've set up my search_index with this field: name_auto = indexes.EdgeNgramField(model_attr='name') and I'm using a search query like so: SearchQuerySet().autocomplete(name_auto='7') However, this search

MapperParsingException on doing rebuild_index in django-haystack with elasticsearch

只谈情不闲聊 提交于 2019-12-05 21:41:22
I'm using java 1.7.0_95 , Django 1.8.4 , Python 3.4.0 , Django Rest Framework 3.1.3 , ElasticSearch 2.3.1 , pyelasticsearch 1.4 and Django Haystack 2.4.1 I'm experiencing an error in elasticsearch every time I try to do python manage.py rebuild_index . This is the error: MapperParsingException[Root mapping definition has unsupported parameters: [_boost : {null_value=1.0, name=boost}]] at org.elasticsearch.index.mapper.DocumentMapperParser.checkNoRemainingFields(DocumentMapperParser.java:171) at org.elasticsearch.index.mapper.DocumentMapperParser.parse(DocumentMapperParser.java:159) at org

Spelling Suggestions with django-haystack and Solr

大城市里の小女人 提交于 2019-12-05 20:54:47
I'm getting "None" for spelling suggestions. First, I have this set in my settings.py file: HAYSTACK_INCLUDE_SPELLING = True I have rebuilt the index: python manage.py rebuild_index and updated it for good measure python manage.py update_index The search works correctly. When I search for "Charger", it returns the results that match. So in my views.py, I then tried: from haystack.query import SearchQuerySet def testpage(request): test_results = SearchQuerySet().auto_query('Chargr') spelling_suggestion = test_results.spelling_suggestion() return render_to_response('testpage.html', { 'test':