0

I store a docx file in sql server database that contains negative number like -56653. I installed Microsoft Filter Pack 2.0 and execute this code:

EXEC sp_fulltext_service 'update_languages'; 
EXEC sp_fulltext_service 'load_os_resources', 1;
EXEC sp_fulltext_service 'restart_all_fdhosts'; 

Then rebuild the Full Text Catalog multiple time, When search 56653, the query not found any things, but when search -56653 the query work fine.

SELECT *
FROM Files
WHERE
   (CONTAINS([Files].[Content], '"56653"'))

Does somebody know what is the problem?

Fred
  • 3,365
  • 4
  • 36
  • 57
  • 1
    I'm not quite sure which word breaker is in use, but it looks like the hyphen (the minus sign) in the beginning of the word in this case is treated as part of the word. Can you check does using of [FREETEXT](https://learn.microsoft.com/en-us/sql/t-sql/queries/freetext-transact-sql?view=sql-server-2017) instead of CONTAINS works for your case? – Andrey Nikolov Nov 26 '18 at 15:19

1 Answers1

0

Finally I found the problem. Full text catalog not indexed content of table which inside a paragraph!

This mean the w:tbl tag move to outside of w:p tag.

<w:p w:rsidR="00E402AA" w:rsidP="00E402AA" w:rsidRDefault="00E402AA">
  <w:pPr>
    <w:bidi />
      <w:spacing w:after="0" w:line="240" w:lineRule="auto" />
      <w:jc w:val="both" />
      <w:rPr>
        <w:bCs />
        <w:sz w:val="24" />
      </w:rPr>
   </w:pPr>
    <w:r>
      <w:rPr>
        <w:bCs />
        <w:sz w:val="24" />
      </w:rPr>
    </w:r>

    <!-- Start Table -->
    <w:tbl>
      <w:tblPr>
        <w:tblStyle w:val="TableGrid" />
        <w:tblW w:w="5000" w:type="pct" />
      </w:tblPr>
      <w:tr>
        <w:tc>
          ...
        </w:tc>
      </w:tr>
    </w:tbl>
    <!-- End Table -->
</w:p>
Fred
  • 3,365
  • 4
  • 36
  • 57