Full-Text Searching using CONSISTS

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sree078
    New Member
    • May 2007
    • 9

    Full-Text Searching using CONSISTS

    Hi

    I've a list of Values with varchar field in main in a table. I wanted to have fast search as there are very less insertions/updations. Thought to do a FullText Searching on that varchar field.

    Imp Note: The name column can be a phrase too.

    I want to search on the key stroke from front end.
    so should be able to search the name column on single charater or words.

    declare @a varchar(10)

    --to search a single value
    --@a = 'a'
    select name from tablename where CONSISTS(name,@ a)

    --to search a word starting with in the text
    set @a = ' " ' + @a + ' *" '
    select name from tablename where CONSISTS(name, @a)

    --if searching a word
    --@a= 'apple'
    select name from tablename where CONSISTS(name,@ a)

    --If searching for a phrase and its continuation
    --@a = 'apple and'
    select name from tablename where CONSISTS(name,' "apple and*" ') --don't result any rows

    --> this all worked out fine individually
    But in stored procedure I need to write only one query
    How to go on with this...
    as I need to use * at the end...But for the last criteria It doesn't work out...
    Plz suggest me a gud way to go on...
  • JustJim
    Recognized Expert Contributor
    • May 2007
    • 407

    #2
    Don't mind me, just subscribing to find out more on this CONSISTS keyword.

    Jim

    Comment

    • missinglinq
      Recognized Expert Specialist
      • Nov 2006
      • 3533

      #3
      I can find no reference to a CONSISTS keyword in Access or VBA, and to be honest none of the code given here looks like VBA. What language are you referring to, sree078?

      Welcome to TheScripts!

      Linq ;0)>

      Comment

      • JKing
        Recognized Expert Top Contributor
        • Jun 2007
        • 1206

        #4
        The code given here looks more like SQL Server or perhaps MySQL can't remember which as I only touched on both briefly in my latest term of school. It's most definitely not Access. Though Access may be used as a front-end I believe this belongs in a seperate forum.

        Comment

        • sree078
          New Member
          • May 2007
          • 9

          #5
          sorry for not giving in the information regarding the languages used:

          Backend: SQL SERVER 2000
          Front End Form in C#.Net -- Visual Studio 2005

          thanks

          Comment

          • missinglinq
            Recognized Expert Specialist
            • Nov 2006
            • 3533

            #6
            You've posted this in the MS Access forum, which is unlikely to get you a resolution to your problem! I'll move the post to the .NET forum.

            Comment

            Working...