Note that there are some explanatory texts on larger screens.

plurals
  1. POSQL Server Fulltext search not finding my rows
    primarykey
    data
    text
    <p>I have a SQL Server table and I'm trying to make sense of fulltext searching :-)</p> <p>I have set up a fulltext catalog and a fulltext index on a table <code>Entry</code>, which contains among other columns a <code>VARCHAR(20)</code> column called <code>VPN-ID</code>.</p> <p>There are about 200'000 rows in that table, and the <code>VPN-ID</code> column has values such as:</p> <pre><code>VPN-000-359-90 VPN-000-363-85 VPN-000-362-07 VPN-000-362-91 VPN-000-355-55 VPN-000-368-36 VPN-000-356-90 </code></pre> <p>Now I'm trying to find rows in that table with a fulltext enabled search.</p> <p>When I do</p> <pre><code>SELECT (list of columns) FROM dbo.Entry WHERE CONTAINS(*, 'VPN-000-362-07') </code></pre> <p>everything's fine and dandy and my rows are returned.</p> <p>When I start searching with a wildcard like this:</p> <pre><code>SELECT (list of columns) FROM dbo.Entry WHERE CONTAINS(*, 'VPN-000-362-%') </code></pre> <p>I am getting results and everything seems fine.</p> <p><strong>HOWEVER:</strong> when I searching like this:</p> <pre><code>SELECT (list of columns) FROM dbo.Entry WHERE CONTAINS(*, 'VPN-000-36%') </code></pre> <p>suddenly I get no results back at all..... even though there are <strong>clearly</strong> rows that match that search criteria...</p> <p>Any ideas why?? What other "surprises" might fulltext search have in store for me? :-)</p> <p><em>Update:</em> to create my fulltext catalog I used:</p> <pre><code>CREATE FULLTEXT CATALOG MyCatalog WITH ACCENT_SENSITIVITY = OFF </code></pre> <p>and to create the fulltext index on my table, I used</p> <pre><code>CREATE FULLTEXT INDEX ON dbo.Entry(list of columns) KEY INDEX PK_Entry </code></pre> <p>I tried to avoid any "oddball" options as much a I could.</p> <p><strong>Update #2:</strong> after a bit more investigation, it appears as if SQL Server Fulltext search somehow interprets my dashes inside the strings as separators....</p> <p>While this query returns nothing:</p> <pre><code>SELECT (list of columns) FROM dbo.Entry WHERE CONTAINS(*, '"VPN-000-362*"') </code></pre> <p>this one does (splitting up the search term on the dashes):</p> <pre><code>SELECT (list of columns) FROM dbo.Entry WHERE CONTAINS(*, ' "VPN" AND "000" AND "362*"') </code></pre> <p>OK - seems a bit odd that a dash appears to result in a splitting up that somehow doesn't work.....</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload