Android and LiveQuery - Advice/best-practise for filtering

Please how to do this ?

Here is my code so far…i detect duplicate like this.

Code REMOVED - It contained defects and wasn't working.