question: private void modifyQueryForSearch ( QueryHelper qh , String columnName , String searchTerm ) { String [ ] words = searchTerm . split ( " " ) ; String [ ] selectionArgs = new String [ words . length * 2 ] ; qh . Selection = "" ; for ( int i = 0 ; i < words . length ; i ++ ) { if ( i != 0 ) { qh . Selection += " AND " ; } qh . Selection += "(" + columnName + " LIKE ? OR " + columnName + " LIKE ?)" ; selectionArgs [ i * 2 ] = "% " + words [ i ] + "%" ; selectionArgs [ ( i * 2 ) + 1 ] = words [ i ] + "%" ; } qh . SelectionArgs = selectionArgs ; }
target:  Modifies a query helper to perform searching. The current algorithm is "beginning of word, union match all words" Modifies Selection and and SelectionArgs Note: This fails if there is already arguments on the query. TODO: support arguments already existing by expanding the array and adding "AND"