MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesMS SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 1st, 2003, 03:45 AM
andy360 andy360 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 4 andy360 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy text searching

I have built a directory that allows users to search via business names.

The data is stored in MS Sql database.
The website has been been developed using asp scripting.

My problem comes down to this.

If a user searches for joe smith refridgeration they can do so by entering joe, smith, joe smith, refridgeration, joe smith refridgeration, smith refridgeration

but i need to make it work if some enters refridgeration joe smith, joe refridgeration etc.

Is this possibe?

Does anyone know how to do it?

Thanks in advance.

Reply With Quote
  #2  
Old December 2nd, 2003, 04:45 PM
Zeron Zeron is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: BC, Canada
Posts: 32 Zeron User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 26 m 47 sec
Reputation Power: 10
Have you ASP code generate a query that has a LIKE statement for every search term like the example below.

SELECT * FROM datatable
WHERE textdata LIKE '%refridgeration%'
AND textdata LIKE '%joe%'
AND textdata LIKE %'smith%'

Reply With Quote
  #3  
Old December 2nd, 2003, 05:06 PM
andy360 andy360 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 4 andy360 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Currently the user is inserting all that data into the one field.
So how would I go about splitting the field down into seperate query string elements?

Reply With Quote
  #4  
Old December 3rd, 2003, 01:32 PM
Zeron Zeron is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: BC, Canada
Posts: 32 Zeron User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 26 m 47 sec
Reputation Power: 10
Not sure how to do it in ASP, but it can't be that difficult. I think you wout use the cut function.

Reply With Quote
  #5  
Old December 3rd, 2003, 06:29 PM
rizzo rizzo is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 7 rizzo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
i use frontpage to modify asp pages and i have a database results proporties options and it lets me split a text field up separated by commas or whatever and you can do your query with like or contains based on a specific field.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > text searching

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap