title: How do I search for a partial word in a CloudKit record?
body: <p>I'm trying to search for CloudKit records containing search text entered by my users.</p>
  
  <p>I have records with these titles (in String format):</p>
  
  <ul>
  <li>Item 1 </li>
  <li>Item 2 </li>
  <li>Item 3  </li>
  <li>Test 1  </li>
  <li>Test 2</li>
  </ul>
  
  <p>I have tried using 'contains':</p>
  
  <pre><code>let predicate = NSPredicate(format: "self contains %@", searchText) 
  let query = CKQuery(recordType: "ShareableItem", predicate: predicate)
      publicDatabase.perform(query, inZoneWith: nil) { results, error in
      ...
  </code></pre>
  
  <p>But this only returns the results I'm looking for if I use a complete word as a search term. </p>
  
  <p>EG. If I search for 'Item', I get back Item 1,Item 2 and Item 3 but if I search for 'tem' I don't get any results.</p>
  
  <p>Is there a way of including a wildcard character in the search or another way of using partial search text?</p>
  
  <p>I've also tried:</p>
  
  <pre><code>NSPredicate(format: "allTokens TOKENMATCHES[cdl] %@", searchText)
  </code></pre>
  
  <p>but with the same result</p>