whoosh

Django-Haystack giving attribute error?

心不动则不痛 提交于 2019-12-07 00:50:15
问题 I am trying to use Haystack and Whoosh with my Django app. I followed the steps on Haystack docs, but i am getting this error when i do a search AttributeError at /search/ 'module' object has no attribute 'get_model' search_indexes.py - import datetime from haystack import indexes from movies.models import Movie class MovieIndex(indexes.SearchIndex, indexes.Indexable): text = indexes.CharField(document=True, use_template=True) title = indexes.CharField(model_attr='title') def get_model(self):

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

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

Haystack search on a many to many field is not working

独自空忆成欢 提交于 2019-12-05 06:56:33
I'm trying to run a search on a model that has a many to many field, and I want to filter the search using this field. here is my current code: search_indexes.py class ListingInex(indexes.SearchIndex, indexes.Indexable): text = indexes.CharField(document=True, use_template=True) business_name = indexes.CharField(model_attr='business_name') category = indexes.MultiValueField(indexed=True, stored=True) city = indexes.CharField(model_attr='city') neighborhood= indexes.CharField(model_attr='neighborhood') state = indexes.CharField(model_attr='state') address = indexes.CharField(model_attr='address

Fuzzy text search in python

江枫思渺然 提交于 2019-12-04 23:09:33
问题 I am wondering if there has any Python library can conduct fuzzy text search. For example: I have three keywords "letter" , "stamp" , and "mail" . I would like to have a function to check if those three words are within the same paragraph (or certain distances, one page). In addition, those words have to maintain the same order. It is fine that other words appear between those three words. I have tried fuzzywuzzy which did not solve my problem. Another library Whoosh looks powerful, but I did

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 =

Fuzzy text search in python

非 Y 不嫁゛ 提交于 2019-12-03 14:29:36
I am wondering if there has any Python library can conduct fuzzy text search. For example: I have three keywords "letter" , "stamp" , and "mail" . I would like to have a function to check if those three words are within the same paragraph (or certain distances, one page). In addition, those words have to maintain the same order. It is fine that other words appear between those three words. I have tried fuzzywuzzy which did not solve my problem. Another library Whoosh looks powerful, but I did not find the proper function... {1} You can do this in Whoosh 2.7 . It has fuzzy search by adding the

Flask app search bar

£可爱£侵袭症+ 提交于 2019-12-03 10:20:54
问题 I am trying to implement a search bar using Flask, but when I enter the url/search, I got a 405 error, Method Not Allowed . Here is a snippet of my code. Any help would be appreciated! forms.py from wtforms import StringField from wtforms.validators import DataRequired class SearchForm(Form): search = StringField('search', [DataRequired()]) submit = SubmitField('Search', render_kw={'class': 'btn btn-success btn-block'}) views.py from flask_login import login_required from forms import

Whoosh index viewer

為{幸葍}努か 提交于 2019-12-03 08:09:10
问题 I'm using haystack with whoosh as backend for a Django app. Is there any way to view the content (in a easy to read format) of the indexes generated by whoosh? I'd like to see what data was indexed and how so I can better understand how it works. 回答1: You can do this pretty easily from python's interactive console: >>> from whoosh.index import open_dir >>> ix = open_dir('whoosh_index') >>> ix.schema <<< <Schema: ['author', 'author_exact', 'content', 'django_ct', 'django_id', 'id', 'lexer',

Flask app search bar

给你一囗甜甜゛ 提交于 2019-12-03 00:52:14
I am trying to implement a search bar using Flask, but when I enter the url/search, I got a 405 error, Method Not Allowed . Here is a snippet of my code. Any help would be appreciated! forms.py from wtforms import StringField from wtforms.validators import DataRequired class SearchForm(Form): search = StringField('search', [DataRequired()]) submit = SubmitField('Search', render_kw={'class': 'btn btn-success btn-block'}) views.py from flask_login import login_required from forms import SearchForm from models import User @app.route('/') def index(): if current_user.is_authenticated: return