whoosh

My output is not giving the documents matched for the query

♀尐吖头ヾ 提交于 2019-12-11 19:08:14
问题 I have a folder called pads in which there are six notepad documents with some text in each of them. Am trying to build a whoosh code that will return the appropriate document for the query string but am getting output as runtime, help appreciated import os from whoosh.index import create_in from whoosh.fields import Schema, TEXT, ID import sys from whoosh.qparser import QueryParser from whoosh import scoring from whoosh.index import open_dir def createSearchableData(root): ''' Schema

no result are found - haystack django whoosh

半城伤御伤魂 提交于 2019-12-11 04:03:38
问题 I have a huge problem! I am using haystack and whoosh and django. I am sure I've done everything that is required to be done to make it works according to the documentation. BUT!!!! results of searching are: "no results found" all the time. But if symbols I put into the form are spaces, every objects I've indexed are printed Details: In my search_indexes.py I have: from haystack.indexes import * from haystack import site from aias.models import Uspd class UspdIndex(SearchIndex): text =

Python: Whoosh seems to return incorrect results

我的梦境 提交于 2019-12-11 03:22:51
问题 This code is straight from Whoosh's quickstart docs: import os.path from whoosh.index import create_in from whoosh.fields import Schema, STORED, ID, KEYWORD, TEXT from whoosh.index import open_dir from whoosh.query import * from whoosh.qparser import QueryParser #establish schema to be used in the index schema = Schema(title=TEXT(stored=True), content=TEXT, path=ID(stored=True), tags=KEYWORD, icon=STORED) #create index directory if not os.path.exists("index"): os.mkdir("index") #create the

(haystack + whoosh) {{ result.object.get_absolute_url }} is not working

旧城冷巷雨未停 提交于 2019-12-11 03:22:31
问题 I am using haystack (2.1.1) and whoosh in my django (1.7) website. i am happy because it is working, but not completely. the app show the right searches but when i click in the results it doesn't go to the product page. it looks like i haven't configured something that make {{ result.object.get_absolute_url }} doesnt work properly. I hope any of you can help me (as reference i am putting all the code) this is my app models (products/models) from django.db import models class Products(models

Flask-WhooshAlchemy with existing database

不问归期 提交于 2019-12-11 02:47:22
问题 How can I get Flask-WhooshAlchemy to create the .seg files for an already existing database filled with records? By calling: with app.app_context(): whooshalchemy.whoosh_index(app, MappedClass) I can get the .toc file, but the .seg files will only be created and once I insert a record directly via Flask-WhooshAlchemy interface. Thus all already existing records will never be included in a whoosh search. 回答1: Here is a script that indexes an existing database. FWIW, Whoosh refers to that as

Django Haystack Rebuild Index

匆匆过客 提交于 2019-12-11 01:37:57
问题 I was reading the 'Getting Started' guide of Haystack and tried to implement Whoosh backend for my website with Haystack. I was successful in setting up the whole project and I can also see the search box on my search.html template. I am unable to build the index though. When I type ./manage.py rebuild_index, I get the error: Unknown command: rebuild_index I know this is a trivial issue. I am unable to understand how the manage.py file can ever understand commands that were not originally a

Document comparison / similarity using Whoosh Python Search Library

流过昼夜 提交于 2019-12-10 20:24:12
问题 How do I get a similarity measure of a document using Whoosh? I want to create a "Related" feature that ranks other previously indexed documents that have a high similarity to a document. Do I input the document as a long query string? Do I add the document to the index and extract a similarity query result somehow from there? Thanks 回答1: The Whoosh searcher class has a method called 'more_like()'. It allows you to compare and indexed document to other indexed documents and returns a list of

Haystack / Whoosh Index Generation Error

天涯浪子 提交于 2019-12-10 18:58:47
问题 I'm trying to setup haystack with whoosh backend. When i try to gen the index [or any index command for that matter] i receive: TypeError: Item in ``from list'' not a string if i completely remove my search_indexes.py i get the same error [so i'm guessing it can't find that file at all] what might cause this error? it's set to autodiscover and i'm sure my app is installed because i'm currently using it. Full traceback: Traceback (most recent call last): File "./manage.py", line 17, in <module

python whoosh IndexingError when interrupted

回眸只為那壹抹淺笑 提交于 2019-12-10 11:36:38
问题 This strange error appears after i had interrupted whoosh commit process. When i am trying to commit now i'm getting File "/usr/local/lib/python2.7/dist-packages/whoosh/filedb/filewriting.py", line 179, in _check_state raise IndexingError("This writer is closed") whoosh.writing.IndexingError: This writer is closed I've tried to reinstall lib, change the index directory but it doesn't work. So how could i repair whoosh? 回答1: I think there is no need to "repair whoosh" (or the index). It might

Django 2.0 haystack whoosh update index, rebuild index throw error

走远了吗. 提交于 2019-12-10 10:13:06
问题 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