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;
}

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 ; }
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 "
