Wednesday, 7 March 2012

Confused on partial word match

Hi all,
I am trying to do a partial word search in SQL but it does not look
possible with FTS. Can anyone clarify?
Specifically, I am searching a 'lastname' field and want to find any
partial matches. So that 'tua' and 'stuart' both match the record with
a lastname field value of 'stuart'.
I can see that prefixes are not supported in Contains for simple search
terms. Am I missing something? If not, this is quite bizarre, I would
expect a full text indexing product to be able do to something along
these lines.
After all, using standard (not FTS) SQL you can issue statements like
"select * from table where lastname like '%tua%'" and it will work as
expected.
Any clarification would be appreciated.
Ryan
It is not a feature. You can use the thesaurus option in a freetext search
if you know in advance what all the prefixes might be. Otherwise you are
limited to a like search.
Another option might be using the fuzzy grouping in SQL 2005 IS. You can't
do real time queries with this, but could massage your data using this.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Ryan" <ryano@.lightsdown.com> wrote in message
news:1126093002.759862.187060@.g44g2000cwa.googlegr oups.com...
> Hi all,
> I am trying to do a partial word search in SQL but it does not look
> possible with FTS. Can anyone clarify?
> Specifically, I am searching a 'lastname' field and want to find any
> partial matches. So that 'tua' and 'stuart' both match the record with
> a lastname field value of 'stuart'.
> I can see that prefixes are not supported in Contains for simple search
> terms. Am I missing something? If not, this is quite bizarre, I would
> expect a full text indexing product to be able do to something along
> these lines.
> After all, using standard (not FTS) SQL you can issue statements like
> "select * from table where lastname like '%tua%'" and it will work as
> expected.
> Any clarification would be appreciated.
> Ryan
>
|||Thanks Hilary,
I'm quite miffed that SQL 2K does not support this, I was hoping that
2005 would but from your hint above it seems that it might be another
bodge job.
I'm very disappointed with MS (and I do enjoy developing using their
stuff). Five years after SQL 2K and it looks like SQL is still going to
be lacking in some major areas of the language.
For example;
Date manipulation.
String manipulation.
Comprehensive full text.
Heirarchical queries
and lots of other brick walls I have hit over the years.
But thanks for your answer though,
Ryan

No comments:

Post a Comment