Re: conditionally query a catalogue's field



Full text index an indexed view. Have the view only show you the rows where
active=2. This is only available in SQL 2005. In SQL 2000 you would have to
partition the table into child tables where one of the child tables would
only have rows where the status column is 2.

--
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



<mark.brady@xxxxxxxxxxxxxxxxxxx> wrote in message
news:1157942252.077692.218360@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I have recently used the 'top_n_by_rank' clause in a full text
query in order to reduce the query execution time.

Here is the senario - we have a table called 'article' that has
three fields.
ID int,
Active bit,
Body varchar(8000)

I want use the top_n_by_rank clause to only return the top 10 articles.
Simple enough but out of the top 10 articles returned only 2 of those
were active.
Is there a way to conditionally query a catalogue field?

My FT query is below:

SELECT
*
FROM
Article AS FT_TBL
INNER JOIN CONTAINSTABLE(Article,
Body,
@vchQuery,
10
) AS KEY_TBL ON FT_TBL.ID = KEY_TBL.[KEY]
WHERE
FT_TBL.Active = 1

This seems to return the top 10 articles from the catalogue then
filters based on the where clause. I would like it to filter before
doing the FT search.

Thanks



.



Relevant Pages

  • conditionally query a catalogues field
    ... query in order to reduce the query execution time. ... I want use the top_n_by_rank clause to only return the top 10 articles. ... filters based on the where clause. ...
    (microsoft.public.sqlserver.fulltext)
  • Re: Query vs form with child & parent: Deleting rows
    ... subordinate to that record, that is, all individuals (and sometimes child ... companies) whose Owner field contains the record key of the parent company. ... That second form is fed by this query: ... But I have a child table called "Channel"; ...
    (microsoft.public.access.forms)
  • Re: SQL Statement - Form/SubForm
    ... table out of the sub form in the control tab if the user clicks saves on the ... All you have to do is change that sub-form on the tab to a regular bunch of ... So, to do this, you just built a nice query in the query builder. ... Now drop in the child table. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Two tables / one to many relationship - need single record
    ... Convert the query to a crosstab, specifying File as row hearder, Child / DOB ... The desired recordset would include the needed client ...
    (microsoft.public.access.queries)
  • Re: Queries involving subforms
    ... If you create your query, with the parent & child tables joined, and add the ... you will get as many as there are child rows ...
    (microsoft.public.access.queries)

Loading