person1976 (10) [Avatar] Offline
#1
When you're paging (ex. 25 per page) how does a filter work? The scenario that I'm wondering about is where you get back 25 objects, then you run those objects through the filter... which presumably removes objects. How do you know that you haven't left out valid results due to pagination?

Concrete example:

1. You do a fulltext query that returns the highest scoring 25 results
2. Your filter removes 5 items so you're left with 20 items
3. Your index has 20 more lower scoring items that _could_ be shown for this query

Is this is an issue when using filters?
john.griffin (36) [Avatar] Offline
#2
Re: Hibernate Search Filters with Paging
1976 (good year :>smilie

I'm not the greatest with filters but since filters are applied before results are presented (pagination or not) only the results that pass the filter ever show up. So, with pagination of 20 and 30 results to your query with a filter that allows 27 of those results. You'll have two pages, the first of 25 and the second of 2.

Sanne (or Emmanuel - are you on vacation?) do you confirm this?

Hope this helps.
emmanuel.bernard (101) [Avatar] Offline
#3
Re: Hibernate Search Filters with Paging
It's correct. Pagination is applied after the filter process so there is no "hole":
- query
- get the ids of matching documents
- filter
- paginate
- load the paginated docs
- load the paginated objects
person1976 (10) [Avatar] Offline
#4
Re: Hibernate Search Filters with Paging
Very cool. Thanks for the info!