But there is a problem with this search, I can only filter by value a secondaryKey, and after by the *"fromKey" and "toKey", * the primary Key.

In my case I filter by employeeName and departamentId, two secondary keys of Employee entity, so the result of search doing by subIndex and by entities can just filter by departamentId and by employeeId (not by departamentId and employeeName)

Check the entities taken from page 4 of http://www.oracle.com/technetwork/products/berkeleydb/performing.pdf

So as far as I know it's not possible to do a range search by employeeName and by departamentId (two secondary key) on the Employee Entity even with query passing range.

Yes, it is not possible to use more than one secondary key to do a range search. So you must pick one key and use it to do the range search. Then do filtering to implement the rest of the query.

Filtering can always be done on any attribute of the entity, because you have the entity object in hand. Filtering is not implemented using a secondary key index, it is implemented by just checking the attributes and discarding any entities that don't match, i.e., with an "if" statement.