Yesterday I created a full text index on a single field in my database with
365000 rows in order to do some performance testing to see if moving to a
full text index would provide significant improvement over LIKE clauses for
looking up words in titles of products. I now need to create indexes on a
couple more rows, and so I need to drop the existing index and create a new
one. However, it's now 3 hours later and iSQL is still running my drop
statement. How long does it normally take to drop a full text index of 98045
unique words with 364704 items, totalling 13MB? If I right click on the
catalog in SQL Ent Manager and choose Properties it shows the catalog as
idle. No errors are being returned by iSQL, and there is nothing in either
the W2K Event Log or the SQL log to indicate there is a problem. Please help
:|
Dan
This should happen well within a minute. run sp_lock to see if there is any
locking.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"Daniel Crichton" <msnews@.worldofspack.co.uk> wrote in message
news:emlT0SGrEHA.868@.TK2MSFTNGP10.phx.gbl...
> Yesterday I created a full text index on a single field in my database
with
> 365000 rows in order to do some performance testing to see if moving to a
> full text index would provide significant improvement over LIKE clauses
for
> looking up words in titles of products. I now need to create indexes on a
> couple more rows, and so I need to drop the existing index and create a
new
> one. However, it's now 3 hours later and iSQL is still running my drop
> statement. How long does it normally take to drop a full text index of
98045
> unique words with 364704 items, totalling 13MB? If I right click on the
> catalog in SQL Ent Manager and choose Properties it shows the catalog as
> idle. No errors are being returned by iSQL, and there is nothing in either
> the W2K Event Log or the SQL log to indicate there is a problem. Please
help
> :|
> Dan
>
|||"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:eX8NLVGrEHA.896@.TK2MSFTNGP12.phx.gbl...
> This should happen well within a minute. run sp_lock to see if there is
any
> locking.
I knew I'd forgotten to do something :|
Thanks for the help. I found a stuck connection from a process that ran a
9:26 last night that for reason hadn't cleared - the process ended after
only a few seconds, yet SQL Server was maintaining the lock. In the end I
had to restart the SQL Server service to get rid of it, then the index
dropped in 5 seconds.
Dan
|||You have to be very careful with locking. SQL FTS does apply row level
locking while doing populations which can aggravate deadlocks and
maintenance operations like the one you have discovered.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"Daniel Crichton" <msnews@.worldofspack.co.uk> wrote in message
news:eSpySqGrEHA.452@.TK2MSFTNGP09.phx.gbl...
> "Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
> news:eX8NLVGrEHA.896@.TK2MSFTNGP12.phx.gbl...
> any
> I knew I'd forgotten to do something :|
> Thanks for the help. I found a stuck connection from a process that ran a
> 9:26 last night that for reason hadn't cleared - the process ended after
> only a few seconds, yet SQL Server was maintaining the lock. In the end I
> had to restart the SQL Server service to get rid of it, then the index
> dropped in 5 seconds.
> Dan
>
Showing posts with label order. Show all posts
Showing posts with label order. Show all posts
Monday, March 12, 2012
Friday, March 9, 2012
How lock few tables at ones?
In order to prevent dead lock we need to avoid situation that one
Thread run transaction that lock tables A and after lock table B,
While another thread can be lock these tables in opposite order.
In my situation, I work on exists DB, and I must lock customer stuff from
all
Table at one, to ensure that other thread not get lock in another order and
I
Fail to deadlock.
How I can lock few tables for special customer in one statement?
"In one statement" - Are you talking about in code (C# or VB.net) or SQL
scripts?
"Mttc" wrote:
> In order to prevent dead lock we need to avoid situation that one
> Thread run transaction that lock tables A and after lock table B,
> While another thread can be lock these tables in opposite order.
> In my situation, I work on exists DB, and I must lock customer stuff from
> all
> Table at one, to ensure that other thread not get lock in another order and
> I
> Fail to deadlock.
> How I can lock few tables for special customer in one statement?
>
>
|||Mttc wrote:
> In order to prevent dead lock we need to avoid situation that one
> Thread run transaction that lock tables A and after lock table B,
> While another thread can be lock these tables in opposite order.
> In my situation, I work on exists DB, and I must lock customer stuff
> from all
> Table at one, to ensure that other thread not get lock in another
> order and I
> Fail to deadlock.
> How I can lock few tables for special customer in one statement?
Not to state the obvious, but one way to prevetn deadlocks is to access
your tables in the same order whereever possible. Can you let us know
why in the case you describe, one of the transactions can't have its
table order switched?
You don't really want to lock the tables, although you can. It will
really affect concurrency in the database.
To lock a table:
begin tran
update employee with (tablockx)
set emp_id = 'PMA42628M'
where emp_id = 'PMA42628M'
From the other transaction, you could first "test" if the table is
available by issuing something like the following which fails if a lock
can't be quickly attained.
Begin Tran
set lock_timeout 0
select TOP 1 emp_id from employee
if @.@.error != 0
print 'Error'
Else
continue
David Gugick
Imceda Software
www.imceda.com
|||in stored procedure
Thread run transaction that lock tables A and after lock table B,
While another thread can be lock these tables in opposite order.
In my situation, I work on exists DB, and I must lock customer stuff from
all
Table at one, to ensure that other thread not get lock in another order and
I
Fail to deadlock.
How I can lock few tables for special customer in one statement?
"In one statement" - Are you talking about in code (C# or VB.net) or SQL
scripts?
"Mttc" wrote:
> In order to prevent dead lock we need to avoid situation that one
> Thread run transaction that lock tables A and after lock table B,
> While another thread can be lock these tables in opposite order.
> In my situation, I work on exists DB, and I must lock customer stuff from
> all
> Table at one, to ensure that other thread not get lock in another order and
> I
> Fail to deadlock.
> How I can lock few tables for special customer in one statement?
>
>
|||Mttc wrote:
> In order to prevent dead lock we need to avoid situation that one
> Thread run transaction that lock tables A and after lock table B,
> While another thread can be lock these tables in opposite order.
> In my situation, I work on exists DB, and I must lock customer stuff
> from all
> Table at one, to ensure that other thread not get lock in another
> order and I
> Fail to deadlock.
> How I can lock few tables for special customer in one statement?
Not to state the obvious, but one way to prevetn deadlocks is to access
your tables in the same order whereever possible. Can you let us know
why in the case you describe, one of the transactions can't have its
table order switched?
You don't really want to lock the tables, although you can. It will
really affect concurrency in the database.
To lock a table:
begin tran
update employee with (tablockx)
set emp_id = 'PMA42628M'
where emp_id = 'PMA42628M'
From the other transaction, you could first "test" if the table is
available by issuing something like the following which fails if a lock
can't be quickly attained.
Begin Tran
set lock_timeout 0
select TOP 1 emp_id from employee
if @.@.error != 0
print 'Error'
Else
continue
David Gugick
Imceda Software
www.imceda.com
|||in stored procedure
How lock few tables at ones?
In order to prevent dead lock we need to avoid situation that one
Thread run transaction that lock tables A and after lock table B,
While another thread can be lock these tables in opposite order.
In my situation, I work on exists DB, and I must lock customer stuff from
all
Table at one, to ensure that other thread not get lock in another order and
I
Fail to deadlock.
How I can lock few tables for special customer in one statement?"In one statement" - Are you talking about in code (C# or VB.net) or SQL
scripts?
"Mttc" wrote:
> In order to prevent dead lock we need to avoid situation that one
> Thread run transaction that lock tables A and after lock table B,
> While another thread can be lock these tables in opposite order.
> In my situation, I work on exists DB, and I must lock customer stuff from
> all
> Table at one, to ensure that other thread not get lock in another order an
d
> I
> Fail to deadlock.
> How I can lock few tables for special customer in one statement?
>
>|||Mttc wrote:
> In order to prevent dead lock we need to avoid situation that one
> Thread run transaction that lock tables A and after lock table B,
> While another thread can be lock these tables in opposite order.
> In my situation, I work on exists DB, and I must lock customer stuff
> from all
> Table at one, to ensure that other thread not get lock in another
> order and I
> Fail to deadlock.
> How I can lock few tables for special customer in one statement?
Not to state the obvious, but one way to prevetn deadlocks is to access
your tables in the same order whereever possible. Can you let us know
why in the case you describe, one of the transactions can't have its
table order switched?
You don't really want to lock the tables, although you can. It will
really affect concurrency in the database.
To lock a table:
begin tran
update employee with (tablockx)
set emp_id = 'PMA42628M'
where emp_id = 'PMA42628M'
From the other transaction, you could first "test" if the table is
available by issuing something like the following which fails if a lock
can't be quickly attained.
Begin Tran
set lock_timeout 0
select TOP 1 emp_id from employee
if @.@.error != 0
print 'Error'
Else
continue
David Gugick
Imceda Software
www.imceda.com|||in stored procedure
Thread run transaction that lock tables A and after lock table B,
While another thread can be lock these tables in opposite order.
In my situation, I work on exists DB, and I must lock customer stuff from
all
Table at one, to ensure that other thread not get lock in another order and
I
Fail to deadlock.
How I can lock few tables for special customer in one statement?"In one statement" - Are you talking about in code (C# or VB.net) or SQL
scripts?
"Mttc" wrote:
> In order to prevent dead lock we need to avoid situation that one
> Thread run transaction that lock tables A and after lock table B,
> While another thread can be lock these tables in opposite order.
> In my situation, I work on exists DB, and I must lock customer stuff from
> all
> Table at one, to ensure that other thread not get lock in another order an
d
> I
> Fail to deadlock.
> How I can lock few tables for special customer in one statement?
>
>|||Mttc wrote:
> In order to prevent dead lock we need to avoid situation that one
> Thread run transaction that lock tables A and after lock table B,
> While another thread can be lock these tables in opposite order.
> In my situation, I work on exists DB, and I must lock customer stuff
> from all
> Table at one, to ensure that other thread not get lock in another
> order and I
> Fail to deadlock.
> How I can lock few tables for special customer in one statement?
Not to state the obvious, but one way to prevetn deadlocks is to access
your tables in the same order whereever possible. Can you let us know
why in the case you describe, one of the transactions can't have its
table order switched?
You don't really want to lock the tables, although you can. It will
really affect concurrency in the database.
To lock a table:
begin tran
update employee with (tablockx)
set emp_id = 'PMA42628M'
where emp_id = 'PMA42628M'
From the other transaction, you could first "test" if the table is
available by issuing something like the following which fails if a lock
can't be quickly attained.
Begin Tran
set lock_timeout 0
select TOP 1 emp_id from employee
if @.@.error != 0
print 'Error'
Else
continue
David Gugick
Imceda Software
www.imceda.com|||in stored procedure
How lock few tables at ones?
In order to prevent dead lock we need to avoid situation that one
Thread run transaction that lock tables A and after lock table B,
While another thread can be lock these tables in opposite order.
In my situation, I work on exists DB, and I must lock customer stuff from
all
Table at one, to ensure that other thread not get lock in another order and
I
Fail to deadlock.
How I can lock few tables for special customer in one statement?"In one statement" - Are you talking about in code (C# or VB.net) or SQL
scripts?
"Mttc" wrote:
> In order to prevent dead lock we need to avoid situation that one
> Thread run transaction that lock tables A and after lock table B,
> While another thread can be lock these tables in opposite order.
> In my situation, I work on exists DB, and I must lock customer stuff from
> all
> Table at one, to ensure that other thread not get lock in another order and
> I
> Fail to deadlock.
> How I can lock few tables for special customer in one statement?
>
>|||Mttc wrote:
> In order to prevent dead lock we need to avoid situation that one
> Thread run transaction that lock tables A and after lock table B,
> While another thread can be lock these tables in opposite order.
> In my situation, I work on exists DB, and I must lock customer stuff
> from all
> Table at one, to ensure that other thread not get lock in another
> order and I
> Fail to deadlock.
> How I can lock few tables for special customer in one statement?
Not to state the obvious, but one way to prevetn deadlocks is to access
your tables in the same order whereever possible. Can you let us know
why in the case you describe, one of the transactions can't have its
table order switched?
You don't really want to lock the tables, although you can. It will
really affect concurrency in the database.
To lock a table:
begin tran
update employee with (tablockx)
set emp_id = 'PMA42628M'
where emp_id = 'PMA42628M'
From the other transaction, you could first "test" if the table is
available by issuing something like the following which fails if a lock
can't be quickly attained.
Begin Tran
set lock_timeout 0
select TOP 1 emp_id from employee
if @.@.error != 0
print 'Error'
Else
continue
David Gugick
Imceda Software
www.imceda.com|||in stored procedure
Thread run transaction that lock tables A and after lock table B,
While another thread can be lock these tables in opposite order.
In my situation, I work on exists DB, and I must lock customer stuff from
all
Table at one, to ensure that other thread not get lock in another order and
I
Fail to deadlock.
How I can lock few tables for special customer in one statement?"In one statement" - Are you talking about in code (C# or VB.net) or SQL
scripts?
"Mttc" wrote:
> In order to prevent dead lock we need to avoid situation that one
> Thread run transaction that lock tables A and after lock table B,
> While another thread can be lock these tables in opposite order.
> In my situation, I work on exists DB, and I must lock customer stuff from
> all
> Table at one, to ensure that other thread not get lock in another order and
> I
> Fail to deadlock.
> How I can lock few tables for special customer in one statement?
>
>|||Mttc wrote:
> In order to prevent dead lock we need to avoid situation that one
> Thread run transaction that lock tables A and after lock table B,
> While another thread can be lock these tables in opposite order.
> In my situation, I work on exists DB, and I must lock customer stuff
> from all
> Table at one, to ensure that other thread not get lock in another
> order and I
> Fail to deadlock.
> How I can lock few tables for special customer in one statement?
Not to state the obvious, but one way to prevetn deadlocks is to access
your tables in the same order whereever possible. Can you let us know
why in the case you describe, one of the transactions can't have its
table order switched?
You don't really want to lock the tables, although you can. It will
really affect concurrency in the database.
To lock a table:
begin tran
update employee with (tablockx)
set emp_id = 'PMA42628M'
where emp_id = 'PMA42628M'
From the other transaction, you could first "test" if the table is
available by issuing something like the following which fails if a lock
can't be quickly attained.
Begin Tran
set lock_timeout 0
select TOP 1 emp_id from employee
if @.@.error != 0
print 'Error'
Else
continue
David Gugick
Imceda Software
www.imceda.com|||in stored procedure
How Is The SQL2000 Desktop Licensed?
Could the SQL2000 Desktop Engine be bought individually or they one
have to buy the Enerprise version in order to get the Desktop Engine?
All we need right now is the Desktop Engine.
Thank you very much
mike
MSDE is free!
http://www.microsoft.com/sql/msde/howtobuy/default.asp
David Portas
SQL Server MVP
|||Mike wrote:
> Could the SQL2000 Desktop Engine be bought individually or they one
> have to buy the Enerprise version in order to get the Desktop Engine?
> All we need right now is the Desktop Engine.
> Thank you very much
> mike
Do you mean "Personal Edition" or MSDE 2000? MSDE 2000 is a free
download from MS: http://www.microsoft.com/sql/msde/default.asp
Personal Edition is included as a part of Standard and Enterprise for
use with workstations and cannot be purchased separately.
David Gugick
Imceda Software
www.imceda.com
have to buy the Enerprise version in order to get the Desktop Engine?
All we need right now is the Desktop Engine.
Thank you very much
mike
MSDE is free!
http://www.microsoft.com/sql/msde/howtobuy/default.asp
David Portas
SQL Server MVP
|||Mike wrote:
> Could the SQL2000 Desktop Engine be bought individually or they one
> have to buy the Enerprise version in order to get the Desktop Engine?
> All we need right now is the Desktop Engine.
> Thank you very much
> mike
Do you mean "Personal Edition" or MSDE 2000? MSDE 2000 is a free
download from MS: http://www.microsoft.com/sql/msde/default.asp
Personal Edition is included as a part of Standard and Enterprise for
use with workstations and cannot be purchased separately.
David Gugick
Imceda Software
www.imceda.com
How Is The SQL2000 Desktop Licensed?
Could the SQL2000 Desktop Engine be bought individually or they one
have to buy the Enerprise version in order to get the Desktop Engine?
have to buy the Enerprise version in order to get the Desktop Engine?
All we need right now is the Desktop Engine.
Thank you very much
mikeMSDE is free!
http://www.microsoft.com/sql/msde/howtobuy/default.asp
--
David Portas
SQL Server MVP
--|||Mike wrote:
> Could the SQL2000 Desktop Engine be bought individually or they one
> have to buy the Enerprise version in order to get the Desktop Engine?
> All we need right now is the Desktop Engine.
> Thank you very much
> mike
Do you mean "Personal Edition" or MSDE 2000? MSDE 2000 is a free
download from MS: http://www.microsoft.com/sql/msde/default.asp
Personal Edition is included as a part of Standard and Enterprise for
use with workstations and cannot be purchased separately.
--
David Gugick
Imceda Software
www.imceda.com
Friday, February 24, 2012
How i get "rank" in this one
Hello
I have this query that works good, but I cant figure out how to get the rank
and order by it desc.
SELECT * FROM Companies WHERE CONTAINS(*,'something')
how I add rank to this one?
TIA
/Lasse
you can't you need to use the contains table syntax for this, ie
SELECT * FROM Companies join ContainsTable(Companies, *, 'something') as FT
on FT.[key]=Companies.pk
where pk is the primary key/unique key of the table you are full text
indexing.
Hilary Cotter
Looking for a SQL Server replication book?
Now available for purchase at:
http://www.nwsu.com/0974973602.html
"Lasse Edsvik" <lasse@.nospam.com> wrote in message
news:%23b1BtZ8yEHA.3808@.tk2msftngp13.phx.gbl...
> Hello
> I have this query that works good, but I cant figure out how to get the
rank
> and order by it desc.
> SELECT * FROM Companies WHERE CONTAINS(*,'something')
> how I add rank to this one?
> TIA
> /Lasse
>
|||Hilary,
hmm, one problem, when i search for both Firstname and Lastname using OR it
doesnt really get the "most correct" values first, they get the highest rank
but...... and if I use AND nothing shows since no columns contain all
"keywords"
is there a way to solve this?
/Lasse
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:uTfQ9M9yEHA.1196@.TK2MSFTNGP15.phx.gbl...
> you can't you need to use the contains table syntax for this, ie
> SELECT * FROM Companies join ContainsTable(Companies, *, 'something') as
FT
> on FT.[key]=Companies.pk
> where pk is the primary key/unique key of the table you are full text
> indexing.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> Now available for purchase at:
> http://www.nwsu.com/0974973602.html
>
> "Lasse Edsvik" <lasse@.nospam.com> wrote in message
> news:%23b1BtZ8yEHA.3808@.tk2msftngp13.phx.gbl...
> rank
>
|||Hilary,
this one returns rank=128
5472 NULL 803 21 GVLE Gvle Valbogatan 35 Andersson & Edlund Sverige
5472
this one rank=112
3714 Sandvikens Kommun Kultur och Fritid 811 80 SANDVIKEN Sandviken
Rita Andersson Sverige 3714
when i search for 'rita OR andersson'
not sure i understand how that first one got higher value
"Lasse Edsvik" <lasse@.nospam.com> wrote in message
news:OYVRKr9yEHA.748@.TK2MSFTNGP14.phx.gbl...
> Hilary,
> hmm, one problem, when i search for both Firstname and Lastname using OR
it
> doesnt really get the "most correct" values first, they get the highest
rank[vbcol=seagreen]
> but...... and if I use AND nothing shows since no columns contain all
> "keywords"
> is there a way to solve this?
> /Lasse
>
> "Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
> news:uTfQ9M9yEHA.1196@.TK2MSFTNGP15.phx.gbl...
as[vbcol=seagreen]
> FT
the
>
|||Lasse,
Adding RANK is easy, understanding the results is a bit more difficult as
you will need to supply additional information about your environment in
order to understand the RANK values that are returned from your FTS queries.
First of all, you should review the SQL Server 2000 BOL title "Full-text
Search Recommendations" and the next to last paragraph on RANK.
Another factor is the number of rows in your table must be "statistically
significantly", i.e.. at least 10,000 rows in order for the query specific
RANK values to return the executants results. If you are testing with a very
small table, then this can explain why the rank values are not what you are
expecting.
As for searching [both Firstname and Lastname using OR it doesn't really get
the "most correct" values first, they get the highest rank
but...... and if I use AND nothing shows since no columns contain all
"keywords"], this is a different problem as SQL Server 2000 (correct?) does
not search across columns, see KB articles:
286787 (Q286787) FIX: Incorrect Results From Full-Text Search on Several
Columns
http://support.microsoft.com/default...b;en-us;286787
294809 (Q294809) FIX: Full-Text Search Queries with CONTAINS Clause Search
Across Columns
http://support.microsoft.com/default...b;en-us;294809
Note, while the above KB articles are specific to SQL Server 7.0, they also
apply to SQL Server 2000 as SQL Server 7.0's behavior was fixed to
correspond to the default SQL Server 2000 behavior.
Finally, one way to join multiple columns in one CONTAINSTABLE query and
influence the rank value of one column over another via the weight parameter
is the following:
use Northwind
SELECT e.LastName, e.FirstName, e.Title, e.Notes, B.[KEY], B.[RANK] as
B_RANK, A.[RANK] as A_RANK
from Employees AS e,
containstable(Employees, Notes, 'ISABOUT (BA weight (.2) )') as A,
containstable(Employees, Title, 'Sales') as B
where
A.[KEY] = e.EmployeeID and
B.[KEY] = e.EmployeeID
Note, the AND condition between the Primary key (PK) values as you can also
make this an OR clause, but you may need to use a DISTINCT parameter to
remove duplicate results. Keep in mind, that you still need a "statistically
significantly" number of rows to get the best results.
Regards,
John
"Lasse Edsvik" <lasse@.nospam.com> wrote in message
news:O#mzCy9yEHA.2012@.TK2MSFTNGP15.phx.gbl...
> Hilary,
> this one returns rank=128
> 5472 NULL 803 21 GVLE Gvle Valbogatan 35 Andersson & Edlund
Sverige
> 5472
> this one rank=112
> 3714 Sandvikens Kommun Kultur och Fritid 811 80 SANDVIKEN Sandviken
> Rita Andersson Sverige 3714
> when i search for 'rita OR andersson'
> not sure i understand how that first one got higher value
>
>
>
> "Lasse Edsvik" <lasse@.nospam.com> wrote in message
> news:OYVRKr9yEHA.748@.TK2MSFTNGP14.phx.gbl...
> it
> rank
> as
> the
>
I have this query that works good, but I cant figure out how to get the rank
and order by it desc.
SELECT * FROM Companies WHERE CONTAINS(*,'something')
how I add rank to this one?
TIA
/Lasse
you can't you need to use the contains table syntax for this, ie
SELECT * FROM Companies join ContainsTable(Companies, *, 'something') as FT
on FT.[key]=Companies.pk
where pk is the primary key/unique key of the table you are full text
indexing.
Hilary Cotter
Looking for a SQL Server replication book?
Now available for purchase at:
http://www.nwsu.com/0974973602.html
"Lasse Edsvik" <lasse@.nospam.com> wrote in message
news:%23b1BtZ8yEHA.3808@.tk2msftngp13.phx.gbl...
> Hello
> I have this query that works good, but I cant figure out how to get the
rank
> and order by it desc.
> SELECT * FROM Companies WHERE CONTAINS(*,'something')
> how I add rank to this one?
> TIA
> /Lasse
>
|||Hilary,
hmm, one problem, when i search for both Firstname and Lastname using OR it
doesnt really get the "most correct" values first, they get the highest rank
but...... and if I use AND nothing shows since no columns contain all
"keywords"
is there a way to solve this?
/Lasse
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:uTfQ9M9yEHA.1196@.TK2MSFTNGP15.phx.gbl...
> you can't you need to use the contains table syntax for this, ie
> SELECT * FROM Companies join ContainsTable(Companies, *, 'something') as
FT
> on FT.[key]=Companies.pk
> where pk is the primary key/unique key of the table you are full text
> indexing.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> Now available for purchase at:
> http://www.nwsu.com/0974973602.html
>
> "Lasse Edsvik" <lasse@.nospam.com> wrote in message
> news:%23b1BtZ8yEHA.3808@.tk2msftngp13.phx.gbl...
> rank
>
|||Hilary,
this one returns rank=128
5472 NULL 803 21 GVLE Gvle Valbogatan 35 Andersson & Edlund Sverige
5472
this one rank=112
3714 Sandvikens Kommun Kultur och Fritid 811 80 SANDVIKEN Sandviken
Rita Andersson Sverige 3714
when i search for 'rita OR andersson'
not sure i understand how that first one got higher value
"Lasse Edsvik" <lasse@.nospam.com> wrote in message
news:OYVRKr9yEHA.748@.TK2MSFTNGP14.phx.gbl...
> Hilary,
> hmm, one problem, when i search for both Firstname and Lastname using OR
it
> doesnt really get the "most correct" values first, they get the highest
rank[vbcol=seagreen]
> but...... and if I use AND nothing shows since no columns contain all
> "keywords"
> is there a way to solve this?
> /Lasse
>
> "Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
> news:uTfQ9M9yEHA.1196@.TK2MSFTNGP15.phx.gbl...
as[vbcol=seagreen]
> FT
the
>
|||Lasse,
Adding RANK is easy, understanding the results is a bit more difficult as
you will need to supply additional information about your environment in
order to understand the RANK values that are returned from your FTS queries.
First of all, you should review the SQL Server 2000 BOL title "Full-text
Search Recommendations" and the next to last paragraph on RANK.
Another factor is the number of rows in your table must be "statistically
significantly", i.e.. at least 10,000 rows in order for the query specific
RANK values to return the executants results. If you are testing with a very
small table, then this can explain why the rank values are not what you are
expecting.
As for searching [both Firstname and Lastname using OR it doesn't really get
the "most correct" values first, they get the highest rank
but...... and if I use AND nothing shows since no columns contain all
"keywords"], this is a different problem as SQL Server 2000 (correct?) does
not search across columns, see KB articles:
286787 (Q286787) FIX: Incorrect Results From Full-Text Search on Several
Columns
http://support.microsoft.com/default...b;en-us;286787
294809 (Q294809) FIX: Full-Text Search Queries with CONTAINS Clause Search
Across Columns
http://support.microsoft.com/default...b;en-us;294809
Note, while the above KB articles are specific to SQL Server 7.0, they also
apply to SQL Server 2000 as SQL Server 7.0's behavior was fixed to
correspond to the default SQL Server 2000 behavior.
Finally, one way to join multiple columns in one CONTAINSTABLE query and
influence the rank value of one column over another via the weight parameter
is the following:
use Northwind
SELECT e.LastName, e.FirstName, e.Title, e.Notes, B.[KEY], B.[RANK] as
B_RANK, A.[RANK] as A_RANK
from Employees AS e,
containstable(Employees, Notes, 'ISABOUT (BA weight (.2) )') as A,
containstable(Employees, Title, 'Sales') as B
where
A.[KEY] = e.EmployeeID and
B.[KEY] = e.EmployeeID
Note, the AND condition between the Primary key (PK) values as you can also
make this an OR clause, but you may need to use a DISTINCT parameter to
remove duplicate results. Keep in mind, that you still need a "statistically
significantly" number of rows to get the best results.
Regards,
John
"Lasse Edsvik" <lasse@.nospam.com> wrote in message
news:O#mzCy9yEHA.2012@.TK2MSFTNGP15.phx.gbl...
> Hilary,
> this one returns rank=128
> 5472 NULL 803 21 GVLE Gvle Valbogatan 35 Andersson & Edlund
Sverige
> 5472
> this one rank=112
> 3714 Sandvikens Kommun Kultur och Fritid 811 80 SANDVIKEN Sandviken
> Rita Andersson Sverige 3714
> when i search for 'rita OR andersson'
> not sure i understand how that first one got higher value
>
>
>
> "Lasse Edsvik" <lasse@.nospam.com> wrote in message
> news:OYVRKr9yEHA.748@.TK2MSFTNGP14.phx.gbl...
> it
> rank
> as
> the
>
Subscribe to:
Posts (Atom)