ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion 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 May 18th, 2005, 01:37 PM
Caden Caden is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 272 Caden User rank is Private First Class (20 - 50 Reputation Level)Caden User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 7 h 8 m 8 sec
Reputation Power: 4
Orginizing Search Results

Hey all,

So, let's say you are using a verity search, and you pull all sorts of stuff from it, and works no problem.

I want to perhaps try to orginize that data. So let's say inside your database you have...

Name, Category, and Topic field...and you search for, let's say "Bill", well, bill maybe the name of a person "Bill S. Preston! ESQ!", or inside a category "How to Bill Clients for more and get away with it", etc.

How can I tell CF to only display things found via the name bill and somewhere else only things found via the category bill, but on the same page.

So,

Searched: Bill
Found Under Name:
Bill S. Preston! ESQ!

Found under Category:
How to Bill Clients for more and get away with it

Thanks!

Reply With Quote
  #2  
Old May 18th, 2005, 01:43 PM
Caden Caden is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 272 Caden User rank is Private First Class (20 - 50 Reputation Level)Caden User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 7 h 8 m 8 sec
Reputation Power: 4
Uhh, I think I just figured it out...

Although you gotta give me respect for that shout out to Bill & Ted

WILD STALIONS!

Reply With Quote
  #3  
Old May 18th, 2005, 01:56 PM
Caden Caden is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 272 Caden User rank is Private First Class (20 - 50 Reputation Level)Caden User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 7 h 8 m 8 sec
Reputation Power: 4
Ok, I take it back, I didn't figure it out, please help =0p

Reply With Quote
  #4  
Old May 18th, 2005, 02:21 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,682 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 15 h 42 m 54 sec
Reputation Power: 53
You might be able to create separate collections. Or you may be able to manipulate the search result set by looping over it or using query of queries on it.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #5  
Old May 18th, 2005, 02:27 PM
Caden Caden is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 272 Caden User rank is Private First Class (20 - 50 Reputation Level)Caden User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 7 h 8 m 8 sec
Reputation Power: 4
any chance you could toss me a simple example of a query in a query?

I'll check the book, but I haven't tried that yet...

Reply With Quote
  #6  
Old May 18th, 2005, 03:38 PM
Caden Caden is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 272 Caden User rank is Private First Class (20 - 50 Reputation Level)Caden User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 7 h 8 m 8 sec
Reputation Power: 4
So I took a different route and ran into a strange problem.

So i've gotten what I want working, like this...

<CFIF (Form.criteria NEQ "")>
<cfsearch
name = "name"
collection = "numberonerulen"
criteria = "#Form.Criteria#">
<cfsearch
name = "category"
collection = "numberonerulec"
criteria = "#Form.Criteria#">
<CFELSE>
<CFLOCATION URL="searchquote.cfm">
<CFABORT>
</CFIF>


<cfquery datasource="numberonerule" name="everythingelse">
Select ID, Name, Quote, Category, Topic
From Quote
where ID = #name.key#
</cfquery>

And then...

<cfoutput query="everythingelse">

<span class="maintext">

Name: #Name#<br>
Quote: #quote#
</cfquery>

Now...when I just run the search to output...I get 3 different results...which makes sense, since there are 3 different records the search should hit via my criteria.

When I use the code above...it only processes for 1 record...why is that?

Thanks
Caden

P.S. It is only displaying the last record...so, it is pulling the 10, 11 and 12th record but only shows record 12.

Reply With Quote
  #7  
Old May 18th, 2005, 04:14 PM
Caden Caden is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 272 Caden User rank is Private First Class (20 - 50 Reputation Level)Caden User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 7 h 8 m 8 sec
Reputation Power: 4
Alright, so I know what the problem is, obviously CFSearch/Query doesn't work like if I was using CFOutput.

Obviously it isn't running through all the records CFSearch finds...anyone know a way to fix that, or if there is a way around it? I've tried looping and such, but it only loops off of that last record...

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Orginizing Search Results


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT