• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

FullText Search - SQL Server

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    #21
    Originally posted by LondonManc View Post
    In summary then, CONTAINS(YourColumn,'Att') doesn't work but CHARINDEX('Att', Yourcolumn) >0 gets results?

    You've created the full-text catalog?

    You've created the full-text index on the table and correctly associated it with the catalog above?

    Have you tried doing it by using the wizard in SSMS?
    Your summary is perfectly correct.

    I tried dropping the index and the catalog and re-creating using the GUI. Still no joy.
    Knock first as I might be balancing my chakras.

    Comment


      #22
      Originally posted by suityou01 View Post
      Your summary is perfectly correct.

      I tried dropping the index and the catalog and re-creating using the GUI. Still no joy.
      I won't have access to SQL Server until weekend, so I guess we'll have to keep an idiot in suspense to see if I can recreate it.
      The greatest trick the devil ever pulled was convincing the world that he didn't exist

      Comment


        #23
        Originally posted by suityou01 View Post
        Hello, can you help me as I am too stupid to figure this out for myself.

        I want to enable FullText search on a Text column. I have added a FullText catalog, and added the column to the catalog and populated the index.
        The FullText search service is running.

        However I get no hits. I should point out that StopWords is off.

        Soooo

        If my column contains 'Attrn' and I search on CONTAINS (MyColumn,'Att') I would expect to get a hit, but I don't.

        Are there any other bear traps I haven't considered?

        FullText is doing a language aware search.

        CONTAINS(MyColumn, 'Att') is looking for the word Att - in this case your word is Attrn so it's not finding a match

        Try

        CONTAINS (MyColumn, '"Att*"' )

        Comment


          #24
          Originally posted by LondonManc View Post
          Att with CONTAINS or FREETEXT should turn up the row where a correctly indexed column contains Att (no wildcards needed).
          Contains the word Att - I think that's where this is failing. It's not doing a string match, it's doing a word match - you need the wildcard for a string match.

          Comment


            #25
            Originally posted by teapot418 View Post
            FullText is doing a language aware search.

            CONTAINS(MyColumn, 'Att') is looking for the word Att - in this case your word is Attrn so it's not finding a match

            Try

            CONTAINS (MyColumn, '"Att*"' )
            Yep, I think this is the key - "Attrn" is not recognised as a logical linguistic extension of "Att". I finally cheated and RTFM
            The greatest trick the devil ever pulled was convincing the world that he didn't exist

            Comment


              #26
              Originally posted by LondonManc View Post
              Yep, I think this is the key - "Attrn" is not recognised as a logical linguistic extension of "Att". I finally cheated and RTFM

              And you message to Suity is?
              The Chunt of Chunts.

              Comment


                #27
                Originally posted by MrMarkyMark View Post
                And you message to Suity is?
                If he'd have RTFM'd yesterday, he wouldn't have need to post.

                SQL Server BooksOnLine is an excellent resource in itself, without the countless blogs out there.
                The greatest trick the devil ever pulled was convincing the world that he didn't exist

                Comment


                  #28
                  surely just

                  where columnname like '%textyouarelookingfor%'

                  works fine too?

                  or am I missing something?

                  Comment


                    #29
                    Originally posted by original PM View Post
                    surely just

                    where columnname like '%textyouarelookingfor%'

                    works fine too?

                    or am I missing something?
                    full text index offers better performance. Wildcards kill off the advantages that you get (a bit like adding a function to a join when joining a date to a datekey integer for example).
                    The greatest trick the devil ever pulled was convincing the world that he didn't exist

                    Comment


                      #30
                      Originally posted by MrMarkyMark View Post
                      You mean apart from the fact that code is wrong......

                      How do you get leading wildcard full-text searches to work in SQL Server? - Stack Overflow

                      My invoice is in the post
                      Originally posted by suityou01 View Post
                      You lost me. How is my code wrong?
                      Originally posted by MrMarkyMark View Post
                      No Wildcard
                      Originally posted by suityou01 View Post
                      You don't always need a wild card. I understand this would force a full table scan, which kind of negates the effect of going to all the trouble of creating a full text index. Contains should match on the string wherever your search string occurs.
                      Originally posted by LondonManc View Post
                      Yep, I think this is the key - "Attrn" is not recognised as a logical linguistic extension of "Att". I finally cheated and RTFM
                      Originally posted by MrMarkyMark View Post
                      And you message to Suity is?
                      Originally posted by teapot418 View Post
                      Contains the word Att - I think that's where this is failing. It's not doing a string match, it's doing a word match - you need the wildcard for a string match.
                      Originally posted by teapot418 View Post
                      FullText is doing a language aware search.

                      CONTAINS(MyColumn, 'Att') is looking for the word Att - in this case your word is Attrn so it's not finding a match

                      Try

                      CONTAINS (MyColumn, '"Att*"' )
                      Knock first as I might be balancing my chakras.

                      Comment

                      Working...
                      X