Chapter 8. Filters: cross-cutting restrictions

This chapter covers
  • Configuring and using dynamic filters
  • Caching filters
  • Various filter examples

Full-text queries are great for answering a question formulated by a user. However, in some situations, you’ll need to add restrictions that don’t belong to the core of the user question. These are cross-cutting restrictions: restrict by security, restrict by category, restrict by availability, and so on. This is what a filter is for.

What is a filter? A filter restricts results of a query after the Lucene query has been executed, usually based on rules that aren’t directly related to the query. Filters can be adjusted independently of the original query and don’t affect the relative score of a document ...

Get Hibernate Search in Action now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.