Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 A problem with using full text search with wildcar

Author  Topic 

Eran
Starting Member

6 Posts

Posted - 2012-12-02 : 13:33:41
Hi,

I have a weird case with the full text search in Sql Server 2008 R2 SP1 web edition.
I have a table that has a row with this value in the indexed field (mapped to a catalog):

logitech wireless keyboard case for ipad eran

When I query like that, I do get this row as expected:
SELECT * FROM TBL_NAME
WHERE CONTAINS (field_name,'"logitech wireless keyboard case for ipad"')

I don't unserstand why when I run the following query, I do not get any result:
SELECT * FROM TBL_NAME
WHERE CONTAINS (field_name,'"logitech wireless keyboard case for ipad*"')

I add the wildcard asterisk after the query phrase, in order to get all the rows that contains the queried phrase,abd that's why I build the string parameter for the CONTAINS query like that:
' + " + the queries string + * + " + '
Isn't that the right way to do that?
And if it is, then why does this row is not returned in this query?

Any advises please?

Thanks!
Eran.

Eran
Starting Member

6 Posts

Posted - 2012-12-03 : 11:51:54
My need is to change an old
LIKE 'search text%'
query
to a full text search query in order to improve performence,
while keeping the search results as close as possible to what I got till now with the old LIKE query.

So, if my old store procedure produced this query:

SELECT * FROM TBL_NAME
WHERE FIELD_NAME LIKE 'logitech wireless keyboard case for ipad%'

Is it possible to use a full text search query and get excactly the same results as I got before with the old query?
If it is, what is the correct way to do so? And if it is not possible,
what would give me the closest results (I would rather have more results, not less then before)?


Thanks!
Eran
Go to Top of Page
   

- Advertisement -