 <p>Simplest way would be to use a wild card character (<strong>*</strong>) and add the <code>wildcarded</code> option</p> <pre><code>cts:search(fn:doc(),cts:word-query("*226", ('wildcarded'))) </code></pre> <p><strong>EDIT:</strong> </p> <p>Although this matches the example documents, as Kishan points out in the comments, <strong>the wildcard also matches unwanted documents</strong> (e.g. containing "226226"). </p> <p>Since range indexes are not an option in this case because the data is mixed, here is an alternative hack:</p> <pre><code>cts:search( fn:doc(), cts:word-query( for $lead in ('', '0', '00', '000') return $lead || "226")) </code></pre> <p>Obviously, this depends on how many leading zeros there can be and will only work if this is known and limited.</p>