title: Sorting search results (from Android SearchView query) by number of matches
body: <p>i'm trying to find a good way to sort the search results according to relevance after performing a search with a SearchView in Android. For me relevance means the <em>number of matches</em> in two SQLite text columns</p>
  
  <p>I'm using a CursorLoader and there the sort order can be given to the constructor at the end</p>
  
  <pre><code>CursorLoader tLoader = new CursorLoader(
      getActivity(), ContentProviderM.ARTICLE_CONTENT_URI,
      tProj, tSel, tSelArgs, SORT_ORDER);
  </code></pre>
  
  <p>(or set using the <code>setSortOrder (String sortOrder)</code> method)</p>
  
  <p>But i need more flexibility than this because i'm looking to sort on the number of matches rather than just on one or two columns</p>
  
  <p>The only solution i can see myself is to add another column in my SQLite table, do some processing, and supply that column as the sort column to the CursorLoader</p>
  
  <p>Now for my question: What is the best way to supply the sort order information to the CursorLoader using SQLite syntax, avoiding having to add a new column? (And what could this SQLite code look like?) Also, i'd like to ask more in general: Is there a different solution to this problem that i've missed?</p>
  
  <p>Grateful for any help! And with kind regards,
  Tord</p>