7

I'm trying to use whoosh to add search functionality to my blogapp on appengine but I don't understand some stuff.

The blogentries are indexed with title, content and status fields.

I would like to have different type of results on the public page then on the admin page but without the need to have multiple indexes.

On the frontpage I want visitors to be able to search on visible entries only on the title and content fields and in the admin I want to search also on draft entries.

Can i concatenate searches using QueryParser so I can search on multiple fields?
How could I filter on status:visible with MultifieldParser?

EDIT

didn't test it yet but i got an answer on the whoosh mailing list:

# Create a parser that will search in title and content
qp = qparser.MultifieldParser(["title", "content"], ix.schema)
# Parse the user query
q = qp.parse(user_query_string)
# If request is not admin, filter on status:visible
filterq = query.Term("status", u"visible") if not is_admin else None
# Get search results
results = searcher.search(q, filter=filterq)
aschmid00
  • 7,038
  • 2
  • 47
  • 66

1 Answers1

0

I know this is not strictly an answer but Google added a full text search api similar to whoosh. Perhaps you should try it.

https://developers.google.com/appengine/docs/python/search/overview

Paolo Casciello
  • 7,982
  • 1
  • 43
  • 42
  • thx for the answer... i asked this question over a year ago :) a lot of stuff happened since then. i tried different approaches since then. right now i have an external server with elasticsearch. – aschmid00 Jul 16 '12 at 17:32
  • ops sorry!!! it showed up first in stack overflow and i never noticed the date!! :) – Paolo Casciello Jul 17 '12 at 15:15