1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

need help, to Search from database

Discussion in 'C#' started by vikky17, Feb 2, 2006.

  1. #1
    Hello Friends,

    Actually i am Sticken with a very peculiar problem, related to search

    Actually i have a database with a column "Description" which has a long strings of 1000 characters describing about the produts of the company

    for E.g. "We are manufcaturers of Plastic Raw material, platic containers, Elctrical items Etc.............." & so on.

    so, the problem is that i want when some person search for particular item, i want to show them in the relevance order

    for e.g.
    somebody searches for "plastic container & raw material"

    so i want the record to search for "plastic", "plastic container", "raw material", & "plastic raw material" and single words like "plastic", "Container", "Raw", "Material"

    after the searching i want to put them in relevant order
    -such as the string which contain the actual term should be at top
    -String containing maximum number of keywords should be placed afetr that
    -string contining all the single letters should be placed at last

    Please help me
    i can configure my database as per the requirement,
    i am sticken at this point of time.

    Hoping to get some better response from you folks

    "Thanks" IN ADVANCE

    from

    Vikram Sachdeva
     
    vikky17, Feb 2, 2006 IP
  2. jaymcc

    jaymcc Peon

    Messages:
    139
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi

    I'm going to make an assumption that you are working with a MS SQL database considering you have a string field of 1000 chars. Is this right?

    There is a way to do this however you need to index your database. In much the same way that a spider indexes web pages for content you get a special index service to index your database information for searching in the way you need.

    This is not trivial and requires you install some extra services. I don't think it is likely that you will be able to do this unless you are running your own dedicated server.

    Basically, once the full text indexing is configured you will then be able to return the sort of queries you are looking for ranked by relevance.

    Have a look at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/acdata/ac_8_qd_15_3rqg.asp for more information.

    I must admist that I did this about 3 years ago for a customer, it did work well however took a while to get it working as I had to learn it all. You might want to do a search for 'sql full text search' for a tutorial on google to guide you step by step.

    Hope this helps.

    I'd be interested to know if anyone has done this without using the above method?

    Jay
     
    jaymcc, Feb 2, 2006 IP
  3. vikky17

    vikky17 Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Dear Jay

    thanks for taking time to look at the above problem

    you are right that i am using MSSQl Server and site is hosted with a very big hoster

    and most probably we will find all the tools related to SQL SERVER 2000 on that server and most probably be able to work on it

    and the other thing is that can you please explein me how to do this index step by step, because i am new in this thing

    PLease

    Thanks in Advance
     
    vikky17, Feb 2, 2006 IP
  4. jaymcc

    jaymcc Peon

    Messages:
    139
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Hi

    Initially just try and execute the following tsql command against your database:

    EXEC sp_fulltext_database 'enable'
    Code (markup):
    If you get an error about

    Then this is a good indication that full text indexing just will not work and your webhost will have to install more software on the server to support it.

    Otherwise the best step by step is at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/acdata/ac_8_qd_15_7lup.asp
     
    jaymcc, Feb 2, 2006 IP
  5. vikky17

    vikky17 Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    dear jay

    it give me the following message


    (1 row(s) affected)


    (0 row(s) affected)


    (1 row(s) affected)

    with blank result screen

    and as far as i think it is not an error but a good sign that my host ia a good one
     
    vikky17, Feb 2, 2006 IP
  6. vikky17

    vikky17 Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    dear jay,
    i understand your concept of indxing can u please tell me what we will do afetr getting it indexed

    from Vikram
     
    vikky17, Feb 2, 2006 IP
  7. jaymcc

    jaymcc Peon

    Messages:
    139
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Hi vikky17, you need to read the articles. I'm sorry but the best way to learn is sometimes to just figure it out and read the articles, that way you'll have a better understanding of how it all works.

    Have a go first, let me know if you get stuck.

    J
     
    jaymcc, Feb 3, 2006 IP
    SFOD_D223 likes this.