need help, to Search from database

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.



Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Feb 2nd, 2006, 08:04
New Member
Join Date: Feb 2006
Age: 28
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Angry need help, to Search from database

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
Reply With Quote

  #2 (permalink)  
Old Feb 15th, 2006, 23:08
Up'n'Coming Member
Join Date: Feb 2004
Location: Woodbridge, UK
Age: 27
Posts: 80
Thanks: 0
Thanked 0 Times in 0 Posts
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
Reply With Quote
Reply

Tags
help, search, database

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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


All times are GMT. The time now is 00:08.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43