Skip to content

Conversation

@quantranhong1999
Copy link
Member

Also, modify the search API with SearchOptions and push the offset onto the search engine.


import com.google.common.base.Preconditions;

public record SearchOptions(long offset, long limit) {
Copy link
Contributor

@chibenwa chibenwa Jan 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think ze have a strong type for Limit, I believe we should use it.

A strong typee for offset would also be nice, it likely exist.

int offset = Math.toIntExact(searchOptions.offset());
int limit = Math.toIntExact(searchOptions.limit());

return searcher.searchCollapsedByMessageId(mailboxIds, searchQuery, offset, limit, MESSAGE_ID_FIELD, !SEARCH_HIGHLIGHT)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please pass Search Options to the parameter of the searcher stuff

Comment on lines -791 to +792
limit)
SearchOptions.limit(limit))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indent looks weird

Copy link
Contributor

@chibenwa chibenwa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpicks along the way but IMO it really goes into the right direction

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants