3

I have a database of around 10,000 records. Each record have a text of aprx 40 pages each. I need to implement full-text search in my database coz like query is taking lot of time. I created the index, following these instructions and tried searching using full-text search.Although it increased the speed of showing results. But I am not able to search phrases in my table.

I am using following query for my exact phrase search

select * from ptcsoftcitation
WHERE CONTAINS(Judgment,'"said contention raised by the counsel"');

It's giving all those results which contains all the words but not exact phrase. It's behaving like ' "said" and "contention" and "raised" and "counsel" '

Please help me..

A_Sk
  • 4,532
  • 3
  • 27
  • 51
  • Sounds like an issue with stopwords (common words like "by" and "the" that are removed from the index by default) though I'm not able to reproduce this exact problem. Can you provide the language used in your full text index, the full sentence that contains `said contention raised by the counsel`, and your version of SQL Server? – Keith Oct 27 '15 at 13:34
  • To be clear, I mean the language *setting* used in your full text index. – Keith Oct 27 '15 at 21:07

1 Answers1

0

Assume I have 3 record:

bc
abc
bcd
  • Search exactly:

               = 'bc' will return bc
    
  • Search closely:

               LIKE 'bc' will return bc
    
  • Search contains:

               LIKE '%bc' will return bc and abc
               LIKE 'bc%' will return bc and bcd
               LIKE '%bc%' will return bc, abc and bcd
    

I think your code should:

SELECT * FROM ptcsoftcitation
WHERE Judgment LIKE '%said contention raised by the counsel%'
Nguyễn Hải Triều
  • 1,454
  • 1
  • 8
  • 14