2012年3月26日星期一
Full Text Search on Two columns
column.
For example I have two columns News_Summary,News_Content
In this case the user can specify during search if he wants to search
News_Summary or the News_Content or Both.There also other columns in the
tables.
In any case I want to rank only by News_Content.
What is the easiest way to accomplish this.
This is the Query I am using right now,How do I add one more column to this.
I dont want to use mutlple stored procedures.
SELECT *
FROM news AS FT_TBL INNER JOIN
FREETEXTTABLE(news,news_summary,'FORMSOF(INFLECTIO NAL, "Report")') AS KEY_TBL
ON FT_TBL.news_id= KEY_TBL.[KEY]
WHERE(
expire_dtm>getdate()
)
"Bruce" wrote:
> How do I use FREETEXTTABLE on two columns in a table but rank by only one
> column.
> For example I have two columns News_Summary,News_Content
> In this case the user can specify during search if he wants to search
> News_Summary or the News_Content or Both.There also other columns in the
> tables.
> In any case I want to rank only by News_Content.
> What is the easiest way to accomplish this.
>
|||Bruce,
You can use the following examples of multiple FREETEXTTABLE for multiple
columns in the same table (Employees). Note the "AND" condition between the
Primary Keys, you can also change to an "OR" condition.
-- multiple columns from one FT enable table using FREETEXTTABLE in the
Northwind database
use Northwind
go
SELECT e.LastName, e.FirstName, e.Title, e.Notes
from Employees AS e,
freetexttable(Employees, Notes, 'BA') as A,
freetexttable(Employees, Title, 'Sales') as B
where
A.[KEY] = e.EmployeeID AND
B.[KEY] = e.EmployeeID
use pubs
go
SELECT pub_id, pr_info FROM pub_info
WHERE FREETEXT(pr_info, ' "publish*" ') AND FREETEXT(pub_id, ' "0736*" ')
Yes, you can search as many columns as necessary, but be aware that each FTS
predicate (CONTAINS* or FREETEXT*) is a "round-trip" to the FT Catalog and
depending upon the size of your FT Catalog (based upon the number of rows in
your FT enable table as well as the number of non-noise unique words), your
FTS query performance may be affected.
Regards,
John
"Bruce" <Bruce@.discussions.microsoft.com> wrote in message
news:BD072BA9-6A90-4C72-B61F-35DC691EC044@.microsoft.com...
> This is the Query I am using right now,How do I add one more column to
this.
> I dont want to use mutlple stored procedures.
> SELECT *
> FROM news AS FT_TBL INNER JOIN
> FREETEXTTABLE(news,news_summary,'FORMSOF(INFLECTIO NAL, "Report")') AS
KEY_TBL[vbcol=seagreen]
> ON FT_TBL.news_id= KEY_TBL.[KEY]
> WHERE(
> expire_dtm>getdate()
> )
> "Bruce" wrote:
one[vbcol=seagreen]
sql
2012年3月22日星期四
Full text search can not return result
In my case, I build a full text search query. like "select * from _tt_fields where contains(string,'"development group"')", when I click F5 then execute the sql, it returned the records, but when I click execute the query more than 4 times, it does not return anything!
From http://www.developmentnow.com/g/104_0_0_0_0_0/sql-server-fulltext.htm
Posted via DevelopmentNow.com Groups
http://www.developmentnow.com
Very rarely when you are in the middle of a merge you may get an
inaccurate count like what you are seeing. it lasts for milli-
seconds.
On Jan 16, 4:56 am, ken<nos...@.developmentnow.com> wrote:
> Hi all,
> In my case, I build a full text search query. like "select * from _tt_fields where contains(string,'"development group"')", when I click F5 then execute the sql, it returned the records, but when I click execute the query more than 4 times, it does not return anything!
> Fromhttp://www.developmentnow.com/g/104_0_0_0_0_0/sql-server-fulltext.htm
> Posted via DevelopmentNow.com Groupshttp://www.developmentnow.com
2012年2月24日星期五
Full Backup DB is too large of DB & TL
STS_SupportoDSIES_1.mdf 5.056KB
STS_SupportoDSIES_1_log.LDF 1536KB
STS_SuportDSIES_1_LOG.BAK 18KB (backup of Transaction
Log)
STS_Supportodsies_1.BAK 9.273.877 KB (this is a
Full Backup)
1) I truncate Transaction LOG
2) Shrink DB
3) Execute a Transaction Log backup.
4) Execute a Full backup of DB
the problem is a BIG full backup, what is worng..?
Thaks.!Have you ran FULL BACKUP database WITH INIT option?
<er.fuser@.gmail.com> wrote in message
news:1173788021.710651.177500@.j27g2000cwj.googlegroups.com...
> Hi everyone, im newie in SQL administrator, well... this is the case:
> STS_SupportoDSIES_1.mdf 5.056KB
> STS_SupportoDSIES_1_log.LDF 1536KB
> STS_SuportDSIES_1_LOG.BAK 18KB (backup of Transaction
> Log)
> STS_Supportodsies_1.BAK 9.273.877 KB (this is a
> Full Backup)
> 1) I truncate Transaction LOG
> 2) Shrink DB
> 3) Execute a Transaction Log backup.
> 4) Execute a Full backup of DB
> the problem is a BIG full backup, what is worng..?
> Thaks.!
>|||Hello,
By default the backup files gets appended to the file and will store
multiple backup copies in same backup file. You could see this
using BACKUP HEADERONLY command. If you do not want multiple copies use INIT
option to overwrite the backup file.
Thanks
Hari
<er.fuser@.gmail.com> wrote in message
news:1173788021.710651.177500@.j27g2000cwj.googlegroups.com...
> Hi everyone, im newie in SQL administrator, well... this is the case:
> STS_SupportoDSIES_1.mdf 5.056KB
> STS_SupportoDSIES_1_log.LDF 1536KB
> STS_SuportDSIES_1_LOG.BAK 18KB (backup of Transaction
> Log)
> STS_Supportodsies_1.BAK 9.273.877 KB (this is a
> Full Backup)
> 1) I truncate Transaction LOG
> 2) Shrink DB
> 3) Execute a Transaction Log backup.
> 4) Execute a Full backup of DB
> the problem is a BIG full backup, what is worng..?
> Thaks.!
>|||Yes i do.!!!
this is the command line:
BACKUP DATABASE [STS_SupportoDSIES_1] TO [STS_SuportDSIES_1] WITH
INIT , NOUNLOAD , NAME = N'STS_SupportoDSIES_1 backup', NOSKIP ,
STATS = 10, NOFORMAT
Uri Dimant ha scritto:
> Have you ran FULL BACKUP database WITH INIT option?
>
> <er.fuser@.gmail.com> wrote in message
> news:1173788021.710651.177500@.j27g2000cwj.googlegroups.com...
> > Hi everyone, im newie in SQL administrator, well... this is the case:
> >
> > STS_SupportoDSIES_1.mdf 5.056KB
> > STS_SupportoDSIES_1_log.LDF 1536KB
> > STS_SuportDSIES_1_LOG.BAK 18KB (backup of Transaction
> > Log)
> > STS_Supportodsies_1.BAK 9.273.877 KB (this is a
> > Full Backup)
> >
> > 1) I truncate Transaction LOG
> > 2) Shrink DB
> > 3) Execute a Transaction Log backup.
> > 4) Execute a Full backup of DB
> >
> > the problem is a BIG full backup, what is worng..?
> >
> > Thaks.!
> >|||I suggest you do RESTORE HEADERONLY from STS_Supportodsies_1.BAK to see what is actually on that.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
<er.fuser@.gmail.com> wrote in message news:1173788021.710651.177500@.j27g2000cwj.googlegroups.com...
> Hi everyone, im newie in SQL administrator, well... this is the case:
> STS_SupportoDSIES_1.mdf 5.056KB
> STS_SupportoDSIES_1_log.LDF 1536KB
> STS_SuportDSIES_1_LOG.BAK 18KB (backup of Transaction
> Log)
> STS_Supportodsies_1.BAK 9.273.877 KB (this is a
> Full Backup)
> 1) I truncate Transaction LOG
> 2) Shrink DB
> 3) Execute a Transaction Log backup.
> 4) Execute a Full backup of DB
> the problem is a BIG full backup, what is worng..?
> Thaks.!
>
2012年2月19日星期日
FTS not always case insensitive
Hello
I have a couple of questions about case-sensitivity. Mostly it seems to work, that mean the FTS is not case sensitive. With the following strings, FTS seems not to get the right records. I'm running sql server 2005, noise-words files are empty
I've inserted two rows with the following strings
First Row : b&c
Second Row : B&C
When running a query with contains (field1, 'b&c') or contains (field1, 'B&C'), I only get the first row. The only chance to get the second row is to run the query with contains (field1, ' "B&C" '), but FTS doesn't return the first row...
Any idea how to get both rows without enumerating all the possibilities ? Accent-sensitivity doesn't change the behaviour, tried both.
With normal words, i.e cake, microsoft, it seems to run well.
Thanks for support
Hello
I have another problem, which is probably caused by the german word breaker.
Say you have the word "Krüger", first letter is capital, you can search with a contain-clause "krüger", "Krüger" and also "Krueger", but a search for "krueger" with the first letter not a capital, while the word has a first letter as capital doesn't retrieve the row.
Umlaut processing by the word breaker is case-sensitive.
|||Hello
Found a solution, uppercase the search conditions will retrieve the data :-)
Thought would probably interest anyone...
Regards