Re: Whoosh

206 views
Skip to first unread message

Massimo DiPierro

unread,
Mar 6, 2015, 12:35:40 PM3/6/15
to Ron Chatterjee, web...@googlegroups.com
https://github.com/mdipierro/web2py-haystack

On Mar 6, 2015, at 11:29 AM, Ron Chatterjee <achatte...@gmail.com> wrote:

Is whoosh is supported in DAL. Any example? Or have a js that create SQLFORM.search like SQLFOrM.smartgrid? Searching is important


Message has been deleted

Massimo Di Pierro

unread,
Mar 6, 2015, 1:08:28 PM3/6/15
to web...@googlegroups.com, massimo....@gmail.com
It may need some love. Very few people have used this. It should work fine. It works for me.

On Friday, 6 March 2015 11:40:25 UTC-6, Ron Chatterjee wrote:

Omg, this is exactly what I was looking for. Sooo spooky

Ron Chatterjee

unread,
Mar 6, 2015, 6:50:46 PM3/6/15
to web...@googlegroups.com, massimo....@gmail.com
Does anyone know how to install haystack? I see a python file with .py extension. I need to install whoosk and sunburnt first? Thought may be give haystack a try.

Massimo DiPierro

unread,
Mar 6, 2015, 6:53:14 PM3/6/15
to Ron Chatterjee, web...@googlegroups.com
there should be instructions in the file. You need to install whoosh

Ron Chatterjee

unread,
Mar 6, 2015, 6:56:26 PM3/6/15
to Massimo DiPierro, web...@googlegroups.com

Can u fix smart_query for me? Lol

Massimo DiPierro

unread,
Mar 6, 2015, 6:59:15 PM3/6/15
to Ron Chatterjee, web...@googlegroups.com
What is wrong with smart_query?

Ron Chatterjee

unread,
Mar 6, 2015, 7:11:32 PM3/6/15
to Massimo DiPierro, web...@googlegroups.com

It gives a run time  error on line 110 when I try to pass the variable like u mentioned; list_of_searchble_field =[db.table.field]. It says "field must b a list of fields". I tried to pass it like a set too. Didnt work. I m not the best python guy yet:(. Unfortunately.  Matlab I could fix this in 5 min.

Ron Chatterjee

unread,
Mar 6, 2015, 7:20:28 PM3/6/15
to Massimo DiPierro, web...@googlegroups.com

I think the issue is with the line isinstance (field, Field). When I pass the field.it is a gluon.dal.objects.Field n u r comparing that with pydal.object.Field. I m not sure but its failing both if and else. So it goes to raise. Lol

Massimo DiPierro

unread,
Mar 6, 2015, 7:32:04 PM3/6/15
to Ron Chatterjee, web...@googlegroups.com
Do you have any from …. import Field in your code?

Ron Chatterjee

unread,
Mar 6, 2015, 7:39:56 PM3/6/15
to Massimo DiPierro, web...@googlegroups.com

I did what u told me. I have "from pydal.helpers.methods import smart_query" in my default.py

Ron Chatterjee

unread,
Mar 6, 2015, 7:40:58 PM3/6/15
to Massimo DiPierro, web...@googlegroups.com

In my db.py I have "from gluon.tools import*". Thats the issue?

Message has been deleted

Massimo DiPierro

unread,
Mar 7, 2015, 12:07:35 PM3/7/15
to Ron Chatterjee, web...@googlegroups.com
I run some tests and I cannot reproduce the problem but I pointed you to the wrong function.
This works for me and does what you asked:

db = DAL()
db.define_table('a',Field('b'))
db.a.insert(b="xxx")
query = SQLFORM.build_query([db.a.b],'xxx')
print db(query).select()

Does it work for you?

Ron Chatterjee

unread,
Mar 7, 2015, 1:29:58 PM3/7/15
to web...@googlegroups.com, achatte...@gmail.com
web2py lived up to its promise again and delivered!!! works like a champ. One line put all the search results in your finger tip and that without wring one single line of JS like php will make you do. The magic of python. How cool is that!:-)?

Ben Lawrence

unread,
Jul 7, 2017, 5:11:16 PM7/7/17
to web2py-users, achatte...@gmail.com
Ron, is whoosh faster than the database search e.g. pydal's like, ilike, regexp, startswith, endswith, contains, upper, lower ?
Reply all
Reply to author
Forward
0 new messages