sql server - क्यों SQL पूर्ण पाठ अनुक्रमण # युक्त शब्दों के लिए वापसी परिणाम नहीं देता है?

original title: "sql server - Why doesn't SQL Full Text Indexing return results for words containing #?"


For instance, my query is like the following using SQL Server 2005:

SELECT * FROM Table WHERE FREETEXT(SearchField, 'c#') 

I have a full text index defined to use the column SearchField which returns results when using:

SELECT * FROM Table WHERE SearchField LIKE '%c#%'

I believe # is a special letter, so how do I allow FREETEXT to work correctly for the query above?

उदाहरण के लिए, मेरी क्वेरी SQL Server 2005 का उपयोग करते हुए निम्नलिखित की तरह है: तालिका से चुनें * जहां फ्रीटैक्स (सर्चफिल्ड, 'सी #') मैं एक पूर्ण पाठ सूचकांक कॉलम सर्चफिल्ड का उपयोग करने के लिए परिभाषित किया गया है जो आर ...

यह अनुवाद के बाद का सारांश है, अगर आपको पूरा अनुवाद देखने की आवश्यकता है, तो कृपया 'अनुवाद' आइकन पर क्लिक करें

सभी उत्तर
  • Translate

    The # char is indexed as punctuation and therefore ignored, so it looks like we'll remove the letter C from our word indexing ignore lists.

    Tested it locally after doing that and rebuilding the indexes and I get results!

    Looking at using a different word breaker language on the indexed column, so that those special characters aren't ignored.

    EDIT: I also found this information:

    c# is indexed as c (if c is not in your noise word list, see more on noise word lists later), but C# is indexed as C# (in SQL 2005 and SQL 2000 running on Win2003 regardless if C or c is in your noise word list). It is not only C# that is stored as C#, but any capital letter followed by #. Conversely, c++ ( and any other lower-cased letter followed by a ++) is indexed as c (regardless of whether c is in your noise word list).

  • Translate

    Quoting a much-replicated help page about Indexing Service query language:

    To use specially treated characters such as &, |, ^, #, @, $, (, ), in a query, enclose your query in quotation marks (“).

    As far as I know, full text search in MSSQL is also done by the Indexing Service, so this might help.