Friday, February 24, 2012

Fulltext Search or Like Search

Hi,
I need to search a Items catalog that has a field that is key word
seperated by commas. Would a fulltext search be more productive than a like
searcn. If the use keys in Bic Black Pens then that is all it should bring
up but if they key in pens it should only get pens. With the like I have been
getting despensers. I don't know exactly how Fulltext search would work for
this.
Message posted via droptable.com
http://www.droptable.com/Uwe/Forums.aspx/sql-server-search/200611/1
Hello MattIrwin
Full text would treat words as words and not return misses as in you case.
You can also use full text to use a thesaurus and have much more complicated
searches, i.e. Pen AND NOT Fountain. Which is much more difficult with LIKE
Simon Sabin
SQL Server MVP
http://sqlblogcasts.com/blogs/simons

> Hi,
> I need to search a Items catalog that has a field that is key word
> seperated by commas. Would a fulltext search be more productive than a
> like
> searcn. If the use keys in Bic Black Pens then that is all it should
> bring up but if they key in pens it should only get pens. With the
> like I have been getting despensers. I don't know exactly how Fulltext
> search would work for this.
>
|||Full text for English will break words at white space. So bic black pen
would be broken as three words, bic, black and pen. Dispensers would be
broken as dispensers. In a free text search this would match with
dispensers, dispenser, dispenser's, and dispensers.
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
"MattIrwin via droptable.com" <u28166@.uwe> wrote in message
news:6926b9c20e067@.uwe...
> Hi,
> I need to search a Items catalog that has a field that is key word
> seperated by commas. Would a fulltext search be more productive than a
> like
> searcn. If the use keys in Bic Black Pens then that is all it should
> bring
> up but if they key in pens it should only get pens. With the like I have
> been
> getting despensers. I don't know exactly how Fulltext search would work
> for
> this.
> --
> Message posted via droptable.com
> http://www.droptable.com/Uwe/Forums.aspx/sql-server-search/200611/1
>
|||You need to use a word breaker which breaks the words in the form you want,
Greek I take it. Otherwise I think like is your best bet.
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
"Allan Ebdrup" <ebdrup@.noemail.noemail> wrote in message
news:%23aVerjWNHHA.3424@.TK2MSFTNGP02.phx.gbl...
> "Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
> news:uo8ZEAyBHHA.4892@.TK2MSFTNGP04.phx.gbl...
> I would like to do the opposite.
> When searching for "pdagog" I also want to return results that contain
> "dagplejepdagog" or "pdagogmedhjlper" is ther no other way to
> accomplish this than using LIKE '%pdagog%'.
> Performance using LIKE is very poor, how do I improve performance?
> Kind Regards,
> Allan Ebdrup
>
|||Allan wrote on Thu, 11 Jan 2007 11:11:51 +0100:

> "Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message news:uo8ZEAyBHHA.4892@.TK2MSFTNGP04.phx.gbl...
> I would like to do the opposite.
> When searching for "pdagog" I also want to return results that contain
> "dagplejepdagog" or "pdagogmedhjlper" is ther no other way to
> accomplish this than using LIKE '%pdagog%'.
> Performance using LIKE is very poor, how do I improve performance?
The second example is already possible:
SELECT * FROM Table WHERE CONTAINS(*,'pdagog*')
However, the first example isn't. As Hilary has pointed out, there may be a
language dependent wordbreaker that will split the words as you require.
Another option, if you don't mind increasing the storage requirements, is to
index on a reversed version of the data too. Store a copy of the data in
another column in reverse order, such as
KEY Word RWord
1 dagplejepdagog gogadpejelpgad
and create the FTI on both Word and RWord, then you could use:
SELECT * FROM Table WHERE CONTAINS(*,'pdagog* or gogadp*')
However, this won't work when the term you are searching for is in the
middle of a word.
Dan
|||You could be correct here, my knowledge of these languages is not great. The
ligature or digraph commonly occurs in Greek words transliterated into
English, but these do appear more German or Scandinavian.
You might want to check out this document for more info.
http://www.simple-talk.com/sql/learn-sql-server/sql-server-full-text-search-language-features/
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
"tbh" <femdev@.newsgroups.nospam> wrote in message
news:%23rGPgouOHHA.3544@.TK2MSFTNGP03.phx.gbl...
> "Greek"? looks a bit more like a scandinavian language, doesn't it?
> i think Allan is looking for inflectional forms or compound words
> containing a stem-word in question. i'm interested too (in my case for
> German).
> can anyone point us to good documentation on which languages are supported
> and other details? there is some info here:
> http://msdn2.microsoft.com/en-US/library/ms142507.aspx
> but i would want to learn more.
> cheers,
> Tim Hanson
>

No comments:

Post a Comment