This is a discussion on "need help, to Search from database" within the Classic ASP section. This forum, and the thread "need help, to Search from database are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
need help, to Search from database
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
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 |
|
|
|
|||
|
Re: need help, to Search from database
You will need a stored procedure to do that.
You need to create a temp table, with a column for the PK from your descriptions table, plus a rank number. Your selects will ned to do something like... select ID from descriptions WHERE description LIKE '%' + searchstring + '%', [rank] = 100 INTO #temptable and then split your search string into word parts, and do further selects with lesser ranks depending on how well they meet your WHERE clause... e.g. select .... where descirption like 'word1' and description like 'word 2' so you want to end up with a table like.... |DescID|Rank| | 51 | 100| | 21 | 50 | | 652 | 80 | | 94 | 65 | | 51 | 100| Then you can join that back to your descriptions, order by rank, and bobs your uncle. If I wasn't so busy, i'd write a proper example, but I don't really have the time. You could also try googling for SQL Full Text Search |
![]() |
| Tags |
| help, search, database |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Search Analyst/Account Executive/SEO/PPC/CPC/Search Engine Optimisation/Pay per Click/London | Web JobBot | Job Opportunities | 0 | Nov 22nd, 2006 10:20 |
| SEO/PPC/Search Engine Optimisation/Pay Per Click/Campaigns/Online/Marketing/Agency/Analyst/Search/Manager/Executive/Manchester | Web JobBot | Job Opportunities | 0 | Nov 17th, 2006 11:11 |
| XML Code for transfering data from one SQL Server Database to another database | plolla | Other Programming Languages | 1 | Aug 3rd, 2006 18:37 |
| need help, to Search from database | vikky17 | Databases | 1 | Jul 18th, 2006 18:03 |
| PHP Search systems that will search mysql | bohboh | PHP Forum | 3 | May 10th, 2006 09:52 |