Tuesday, March 20, 2012
add words to FTS dictionary
containstable uses how can I do it? These are not noise words example the 2
letters SP is a word we use over and over also HiCNR
--
cindyYou don't add words to the SQL FTS "dictionary". You might want to replace
your noise word list with an empty space and then rebuild your catalog. SQL
FTS builds its own "dictionary" based on your content.
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
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
"cindy" <cmello@.nospam.nospam> wrote in message
news:20D3663B-C12B-4282-9A9A-BFCFD5B6ABC3@.microsoft.com...
> we are medical company I need to a some words to the dictionary that SQL
> containstable uses how can I do it? These are not noise words example the
> 2
> letters SP is a word we use over and over also HiCNR
> --
> cindy|||for example SP or HiCNR are words in this industry. We have customized sql
to do a boolean search with containstable in stored procedure. A search for
"SP" and "HiCNR" returns correctly matching words in document content. Thes
e
documents are actually rows in a table where Sharepoint stores the content o
f
its document libraries. So will "Magnet" and "heat" for example return as
expected. The problem is with the use of AND NOT. For example "Magnet" and
not "heat" will not bring back content with magnet and without heat whereas
"Magnet" and not "SP" seems to have no effect in eliminating the "SP" word.
I am thinking if I could use a "custom" dictionary have SQL see "SP" as a
word. But then maybe I am not understand the technology. When FTS does a
return is it doing like a split string or REGEX word matching, just saying o
k
here is a word as defined by the word breaker ie there is a space on either
side of "SP" and it is not in the noise word list?
--
cindy
"Hilary Cotter" wrote:
> You don't add words to the SQL FTS "dictionary". You might want to replace
> your noise word list with an empty space and then rebuild your catalog. SQ
L
> FTS builds its own "dictionary" based on your content.
> --
> Hilary Cotter
> Director of Text Mining and Database Strategy
> RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
> This posting is my own and doesn't necessarily represent RelevantNoise's
> positions, strategies or opinions.
> 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
>
> "cindy" <cmello@.nospam.nospam> wrote in message
> news:20D3663B-C12B-4282-9A9A-BFCFD5B6ABC3@.microsoft.com...
>
>|||Hello Cindy,
Based on my scope, SP shall be the same as other word and there is no
internal dictionary and it is built from word breaker.
I was not able to reproduce the issue. The following is the statements
===================================
create table documentTable(ftkey int not null, document ntext)
create unique index DTftkey_idx on documentTable(ftKey)
exec sp_fulltext_column 'documentTable', 'document', 'add'
exec sp_fulltext_table 'documentTable', 'start_change_tracking'
exec sp_fulltext_table 'documentTable', 'start_background_updateindex'
exec sp_fulltext_catalog 'myfulltext','start_full'
insert documenttable values (10, 'words letters SP Magnet')
insert documenttable values (11, 'HiCNR Magnet')
SELECT * FROM documenttable WHERE CONTAINS(document, 'Magnet AND NOT SP')
SELECT * FROM documenttable WHERE CONTAINS(document, 'Magnet')
====================================
I got only 1 record for the first select query.
Best Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
=============
This posting is provided "AS IS" with no warranties, and confers no rights.
Tuesday, March 6, 2012
Add Keywords to Query Analyzers Syntax
highlighting feature? I would think that there would be a text/xml file
that could be modified. This certainly can't be hard coded.
Thanks,
BryanI think you are going to be disappointed then. I know of no way to add
keywords in the way you want.
--
--
Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org
"Bryan Bullard" <reply@.to.group.com> wrote in message
news:zBylc.6707$l_1.5292@.newssvr23.news.prodigy.co m...
> Does anyone know of a way to add *key words* to Query Analyzer's syntax
> highlighting feature? I would think that there would be a text/xml file
> that could be modified. This certainly can't be hard coded.
> Thanks,
> Bryan|||"Allan Mitchell" <allan@.no-spam.sqldts.com> wrote in message
news:4096bd6a$0$31706$fa0fcedb@.lovejoy.zen.co.uk.. .
> I know of no way to add keywords in the way you want.
Then do you know of another way?|||Bryan Bullard (reply@.to.group.com) writes:
> Does anyone know of a way to add *key words* to Query Analyzer's syntax
> highlighting feature? I would think that there would be a text/xml file
> that could be modified. This certainly can't be hard coded.
There is no way to change the list of highlighted words. I would actually
guess that the list is hardcoded. After all, QA is to designed against a
certain version of SQL Server, so new keywords are not likely to appear
out of the blue. :-)
--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Bryan,
It seems that the keywords are contained in the file
"../tools/binn/sqllex.dll" -- part of which appears in plain-text. For fun,
I tried the following command from a Linux prompt (after backing up the
file):
sed 's/CHECKALLOC/RICHDILLON/' sqllex.dll > new.dll
... and then renamed the new file. Sure enough, QA stopped highlighing
"CHECKALLOC" in blue. Sadly, it wouldn't highlight my name, though. :-(
There must be something important about the rest of the gobbledygook in that
file ;-)
Rich
"Bryan Bullard" <reply@.to.group.com> wrote in message
news:zBylc.6707$l_1.5292@.newssvr23.news.prodigy.co m...
> Does anyone know of a way to add *key words* to Query Analyzer's syntax
> highlighting feature? I would think that there would be a text/xml file
> that could be modified. This certainly can't be hard coded.
> Thanks,
> Bryan|||
Quote:
Originally Posted by Erland Sommarskog
Bryan Bullard (reply@.to.group.com) writes:
> Does anyone know of a way to add *key words* to Query Analyzer's syntax
> highlighting feature? I would think that there would be a text/xml file
> that could be modified. This certainly can't be hard coded.
There is no way to change the list of highlighted words. I would actually
guess that the list is hardcoded. After all, QA is to designed against a
certain version of SQL Server, so new keywords are not likely to appear
out of the blue. :-)
--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp
It's actually hardcoded, and found this out the hardway when a dll was no longer registered.
the syntax highlighting functionality is done by a dll named sqllex.dll that is typically found in the C:\Program Files\Microsoft SQL Server\80\Tools\Binn directory;
if you unregister the dll, you'll lose the syntax highlighting completely; re-registering it restores the functionality, which i discovered when uninstalling/reinstalling after a beta of SQL 2005.
because the list of keywords is in the DLL, and not in a file the DLL uses, there's no way to ADD keywords unless you could replace that dll with your own enhanced verison.
HTH.
Add Keywords to Query Analyzers Syntax
highlighting feature? I would think that there would be a text/xml file
that could be modified. This certainly can't be hard coded.
Thanks,
BryanI think you are going to be disappointed then. I know of no way to add
keywords in the way you want.
--
--
Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org
"Bryan Bullard" <reply@.to.group.com> wrote in message
news:zBylc.6707$l_1.5292@.newssvr23.news.prodigy.co m...
> Does anyone know of a way to add *key words* to Query Analyzer's syntax
> highlighting feature? I would think that there would be a text/xml file
> that could be modified. This certainly can't be hard coded.
> Thanks,
> Bryan|||"Allan Mitchell" <allan@.no-spam.sqldts.com> wrote in message
news:4096bd6a$0$31706$fa0fcedb@.lovejoy.zen.co.uk.. .
> I know of no way to add keywords in the way you want.
Then do you know of another way?|||Bryan Bullard (reply@.to.group.com) writes:
> Does anyone know of a way to add *key words* to Query Analyzer's syntax
> highlighting feature? I would think that there would be a text/xml file
> that could be modified. This certainly can't be hard coded.
There is no way to change the list of highlighted words. I would actually
guess that the list is hardcoded. After all, QA is to designed against a
certain version of SQL Server, so new keywords are not likely to appear
out of the blue. :-)
--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Bryan,
It seems that the keywords are contained in the file
"../tools/binn/sqllex.dll" -- part of which appears in plain-text. For fun,
I tried the following command from a Linux prompt (after backing up the
file):
sed 's/CHECKALLOC/RICHDILLON/' sqllex.dll > new.dll
... and then renamed the new file. Sure enough, QA stopped highlighing
"CHECKALLOC" in blue. Sadly, it wouldn't highlight my name, though. :-(
There must be something important about the rest of the gobbledygook in that
file ;-)
Rich
"Bryan Bullard" <reply@.to.group.com> wrote in message
news:zBylc.6707$l_1.5292@.newssvr23.news.prodigy.co m...
> Does anyone know of a way to add *key words* to Query Analyzer's syntax
> highlighting feature? I would think that there would be a text/xml file
> that could be modified. This certainly can't be hard coded.
> Thanks,
> Bryan