Objective: Return all URLs beginning with
WHERE CONTAINS (URL, 'https://mywebsite.domain.com/as/product/4')
All records returned
WHERE CONTAINS (URL, '"https://mywebsite.domain.com/as/product/4*"')
No records returned
You can use
CONTAINS with a
LIKE subquery for matching only a start:
SELECT * FROM ( SELECT * FROM myTable WHERE CONTAINS (URL, '"https://mywebsite.domain.com/as/product/4/"') ) AS S1 WHERE S1.URL LIKE 'https://mywebsite.domain.com/as/product/4/%'
This way, the SLOW
LIKE operator query will be run against a smaller set of records
WHERE CONTAINS (URL, '"https://mywebsite.domain.com/as/product/4/"') is not filtering Values)
After a lot of searches. the problem is in
/ . The forward-slash isn't contained in the Noise Words file, but I guess it's classed as a delimiter or Word breaker and therefore isn't searchable.
Read these Topics:
I found one suggested solution that is
/ is considered as an english wordbreaker You may change It from Registry
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\<InstanceRoot>\MSSearch\Language\engand
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\<InstanceRoot>\MSSearch\Language\enu
Sql server consider
https://mywebsite.domain.com/as/product/4 as one word.
Note: above both path i have taken by assuming that you are using English language as word breaker.
Read more about Word Breaker in This MSDN Topic