torchbox/wagtail — pull request #186 by kaedroho (2014-04-07 08:58:42+00:00)
Title: [WIP] Search changes

This pull request adds the following changes:

- All fields are now added to the index by default for filtering. You only need to configure fields that you want to full text search on
- Scrapped ElasticUtils. Wagtailsearch now talks to elasticsearch-py directly
- Tests are no longer run with wagtailsearch signal handlers enabled
- add_bulk is now a generator (so we can provide feedback during the bulk add process)
- Indexed class refactor
- Queries now run on QuerySets rather than models. This allows more complex filters to be run.

Example of searching on a queryset (using PageQuerySet #185):

search.search(Page.query.descendant_of(events).not_descendant_of(past_events).live(), "Hello world!")

This will search all live pages that are in the events section but exclude pages which are in the past_events sub section.