Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 full-text search

Author  Topic 

looc
Starting Member

10 Posts

Posted - 2009-07-07 : 05:06:28
Hi

Question about full-text search, i have set up a table with two collumns, title and body

I have added a full-text to include both columns.

Now i want to search "google"-style in both columns but i cant get a hit from both at the same querie.

The table include a row: title = abc123, body = xyz987


select title from table where contains((title,body), 'abc123 AND xyz987') is not working


select title from table where contains((title,body), 'abc123) is working and

select title from table where contains((title,body), 'xyz987') is working

How can i get FT to return hits from two different columns?

/bjorn

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-07-07 : 05:08:36
r u using MSSql server or any other ?
Go to Top of Page

waterduck
Aged Yak Warrior

982 Posts

Posted - 2009-07-07 : 05:12:24
quote:
'abc123' AND 'xyz987'

possible is missing ''?

AMITOFO+AMEN+YA ALLAH Hope the query works
Go to Top of Page

looc
Starting Member

10 Posts

Posted - 2009-07-07 : 05:15:32
Hi.

Running mssql 2005

No , problem is not that chars is missing, i have tried all sorts of combinations with " and *
If i try to search keewords in two different columns i just dont get any hits. If is search for two keewords in same column i get hits.

The columns is nvarchar(MAX)

/bjorn
Go to Top of Page

waterduck
Aged Yak Warrior

982 Posts

Posted - 2009-07-07 : 05:20:30
[code]SELECT *
FROM (
select title from table where contains((title,body), 'abc123)
)a JOIN (
select title from table where contains((title,body), 'xyz987')
)b on a.title=b.title and a.body=b.body[/code]
Like that works?Sorry if don't work but im also new to sql ^^

AMITOFO+AMEN+YA ALLAH Hope the query works
Go to Top of Page

looc
Starting Member

10 Posts

Posted - 2009-07-08 : 02:24:29
Hi

No this is not the solution i was looking for.
This must be a common problem, or?

/b.


quote:
Originally posted by waterduck

SELECT	* 
FROM (
select title from table where contains((title,body), 'abc123)
)a JOIN (
select title from table where contains((title,body), 'xyz987')
)b on a.title=b.title and a.body=b.body

Like that works?Sorry if don't work but im also new to sql ^^

AMITOFO+AMEN+YA ALLAH Hope the query works

Go to Top of Page
   

- Advertisement -