Re: CONTAINS, phrases and keywords



Hello ddaiker,

OR is an ignored word, what happens is that the ignored word gets replaced by a token

so your search becomes "two ? three", similarly for the document and is an ignored word, your search will only find a record where two and three appear and are seperated by 1 ignored word.



Simon Sabin
SQL Server MVP
http://sqlblogcasts.com/blogs/simons


I'm getting some results from a CONTAINS query that I find odd. Here
is MyTable:

ID TheText
------------------------
1 two AND three
2 two three
and here is the query that I find odd:
SELECT * FROM MyTable WHERE CONTAINS(*, '"two OR three"')
that's a single quote followed by a double quote and then the reverse
at the end:

It returns row 1 but not row 2 in the results.

The only way I can explain why row 1 is being returned is if SQL is
throwing out both the AND in the data and the OR in the query. But if
that is the case why isn't row 2 being returned?

Anybody have any idea what's going on?



.



Relevant Pages

  • Re: FTS Performance in SQL 2005
    ... Can you post you query plans and the output of statistics IO ... SQL Server MVP ... Because i've set the MAX sql-server memory to 3.5 GB instead of 4.0 GB ... cost relative to the whole batch, ...
    (microsoft.public.sqlserver.fulltext)
  • Re: FTS Performance in SQL 2005
    ... Now if I do a query directly to the field I would theoretically need: ... SQL Server MVP ... Because i've set the MAX sql-server memory to 3.5 GB instead of 4.0 GB ... cost relative to the whole batch, ...
    (microsoft.public.sqlserver.fulltext)
  • Re: Date_Time Convert(24) to DateTime Format
    ... You posted a query in the original post, ... When it's in smalldatetime format then use the ... >>> select counterDateTime from CounterData ... >> Tibor Karaszi, SQL Server MVP ...
    (microsoft.public.sqlserver.programming)
  • Re: Find matching set of items
    ... > "Given a sepcific OrderID" is how the other set would be "passed" or rather> created. ... > This isn't a homework assignment, I was just hoping someone else has had to> solve a similar problem relationally, and could at lease give me some advice> on how to approch the problem. ... >> SQL Server MVP ... >>> Without using a cursor or any kind of looping, I need to write a query ...
    (microsoft.public.sqlserver.programming)
  • Re: Which is more efficient when finding a record?
    ... The problem with just blurting out "x is faster than y but z is faster than ... how many rows match the where clause? ... is it in a stored procedure, view, ad hoc query, function? ... >> (Reverse address to reply.) ...
    (microsoft.public.sqlserver.programming)

Loading