android_catalogue1-8 Exercise 2: Notes, and Accented Letters ============================================================= Matching notes: add one more OR to the DAO query: AND (:pattern = '' OR title LIKE :pattern ESCAPE '\' OR creator LIKE :pattern ESCAPE '\' OR notes LIKE :pattern ESCAPE '\') Is it sensible for "do I own this?" Questionable. Notes are free text ("bought for Sam, not read"), so a search for "Sam" now reports that you "already have" an item that is not the thing you are holding. For the ownership check, title and creator are the honest fields. A good compromise: keep the ownership search on title and creator, and add a separate "search notes too" switch. Accented letters: LIKE only ignores case for ASCII letters, so "é" will not match "É". One fix: 1. Add a column, e.g. searchText, to Item, filled on every save with a normalised version of title + " " + creator (lower-cased, accents removed, e.g. with java.text.Normalizer to NFD and then dropping combining marks). 2. Normalise the user's query the same way before building the pattern. 3. LIKE against searchText. This changes the database, so raise the Room version and write a migration (or, while still developing, uninstall the app). An alternative is the SQLite ICU extension, but it is not available to Room apps by default.