Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. MS SQL query syntax for full text search

MS SQL query syntax for full text search

Scheduled Pinned Locked Moved Database
databasealgorithmshelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Vishnu Nath
    wrote on last edited by
    #1

    Hii, I have a table in a database called dictionary. I have four columns namely id, word , keyword and meaning. I have indexed word, keyword and meaning column in a catalog for full text searching of any word. I want full text searching of any word in these two column and return meaning of that word found in word and keyword column. I searched the table for the word using following query :

    string wordSearched=textBox1.Text;
    "SELECT meaning FROM dictionary WHERE CONTAINS(word, keyword, '+"wordSearched"+')";

    But am unable to get the full text search result. Am i wrong in my syntax for querying full text search. or may be can anyone help it out giving the proper syntax to query word and keyword column. Thanks in Advance!

    Aspiring Techie, Vishnu Nath

    R U 2 Replies Last reply
    0
    • V Vishnu Nath

      Hii, I have a table in a database called dictionary. I have four columns namely id, word , keyword and meaning. I have indexed word, keyword and meaning column in a catalog for full text searching of any word. I want full text searching of any word in these two column and return meaning of that word found in word and keyword column. I searched the table for the word using following query :

      string wordSearched=textBox1.Text;
      "SELECT meaning FROM dictionary WHERE CONTAINS(word, keyword, '+"wordSearched"+')";

      But am unable to get the full text search result. Am i wrong in my syntax for querying full text search. or may be can anyone help it out giving the proper syntax to query word and keyword column. Thanks in Advance!

      Aspiring Techie, Vishnu Nath

      R Offline
      R Offline
      Rajesh Anuhya
      wrote on last edited by
      #2

      Try This Replace Contains :( , with instr :) Use Instr function

      Rajesh B --> A Poor Workman Blames His Tools <--

      1 Reply Last reply
      0
      • V Vishnu Nath

        Hii, I have a table in a database called dictionary. I have four columns namely id, word , keyword and meaning. I have indexed word, keyword and meaning column in a catalog for full text searching of any word. I want full text searching of any word in these two column and return meaning of that word found in word and keyword column. I searched the table for the word using following query :

        string wordSearched=textBox1.Text;
        "SELECT meaning FROM dictionary WHERE CONTAINS(word, keyword, '+"wordSearched"+')";

        But am unable to get the full text search result. Am i wrong in my syntax for querying full text search. or may be can anyone help it out giving the proper syntax to query word and keyword column. Thanks in Advance!

        Aspiring Techie, Vishnu Nath

        U Offline
        U Offline
        User 770156
        wrote on last edited by
        #3

        Hello, You can use asterisk.

        SELECT meaning FROM dictionary WHERE CONTAINS(*, '+"wordSearched"+')

        or

        SELECT meaning FROM dictionary WHERE CONTAINS(word, '+"wordSearched"+') or CONTAINS(keyword, '+"wordSearched"+')

        or containstable sample

        select id, f.[rank], [Name], [Description] from eshop_product inner join containstable(eshop_product,[Description], 'ISABOUT(bike weight(.9), pedals weight(.3) ) ' ) f on eshop_product.id = f.[KEY]

        or use karsa full text search manager I hope this help you Michal

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups