?
Solved

CFINDEX / CFCOLECTION / CFSEARCH

Posted on 2002-07-25
9
Medium Priority
?
321 Views
Last Modified: 2013-12-24
Hi there,

I wanted to use the CFSEARCH ... i have created a collection ... but I dont have a clear picture on how to go ahead ...

I have a member table - with lot of details abt the member ... say around 100 fields having diff sets of data abt the member.

so i create a collection first:
<CFCOLLECTION ACTION="create"
    COLLECTION="akp"
    PATH="C:\CFUSION\Verity\Collections\">

then a index:
<CFQUERY NAME="Member" DATASOURCE="#IWD_DSN#" DBTYPE="ODBC" username="#IWD_USERNAME#" PASSWORD="#IWD_PASSWORD#">    
     SELECT * FROM Tbl_member_m
</CFQUERY>
<CFINDEX action="Update"
     collection="akp"
     key="MemberID"
     title="akp_index"
     type="Custom"
     query="Member"
     body="Age,email,username">


& search:
<CFSEARCH NAME="get"
    COLLECTION="akp" CRITERIA="sh">    
<CFOUTPUT QUERY="get">
     #Key#, #Username#<BR>    
</CFOUTPUT>

======================================================

Now what i want to do here is

1. to be able to display all the data abt the user present in the collection [ie all 100 fields].

2. define criteria for searching thru the collection [like if i wanna search for all members above the age of 24 & who are all males - then how do i do this ]

if ne-of u can help me out on this - it would be really great !!!

thanx for putting in ur time & effort

K'Rgds
Anand
0
Comment
Question by:anandkp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
9 Comments
 
LVL 5

Expert Comment

by:CFXPERT
ID: 7180539
Not quite sure exactly what you want to do.  If you have a table that has all the member information.  WHy do you want to use a collection.

Just query the memeber table with specific filters like.

<cfquery name="getMember" datasource="#IWD_DSN#" username="#IWD_USERNAME#" PASSWORD="#IWD_PASSWORD#">
select *
from Tbl_member_m
where age >= 24
and etc,etc,etc
</cfquery>

To improve the performance of the query just make you add indexes to the columns in your table that will be queried on the most.

0
 
LVL 17

Author Comment

by:anandkp
ID: 7182029
Hi there,

I just want to know - if this is what i want to do - by using a collection - how do go abt doing it ...

I got thru with creation of collection & index ... now in search i want to be able to access all the data of the member table - but currently using the syntax written above - i cannot.

If u could pls tell me where [if] ive gone wrong ... or what is the correct procedure for doing this ... so i can access everything in CFSEarch - as if i was accessing it thru table ...

i'll await ur reply on this ...
Much Appreciation for ur HELP !

K'Rgds
Anand
0
 
LVL 5

Accepted Solution

by:
CFXPERT earned 600 total points
ID: 7192374
To be honest with you.  The method in which you want to use is not practical.  It is much more efficient to access the table that holds the data you want access to directly.  Using a <cfquery>

Most any expert would most likely agree.  Since no other expert has posted to your question I think that verifies my answer to your question.

It's simpl, you're tyring to return rows from a table in a database given a set of criteria.

<cfquery name="getMember" datasource="#IWD_DSN#" username="#IWD_USERNAME#" PASSWORD="#IWD_PASSWORD#">
select *
from Tbl_member_m
where age >= 24
and etc,etc,etc
</cfquery>

This is the way that it should be handled.  First rule of programming,  don't ever make things more complex than they need to be.

If you need help in re-writing any of your code please feel free to email me at kerry@tefftnet.com

I will help you out with all the particulars and get you going in the right direction.

cheers

:)
KWK


0
Plesk WordPress Toolkit

Plesk's WordPress Toolkit allows server administrators, resellers and customers to manage their WordPress instances, enabling a variety of development workflows for WordPress admins of all skill levels, from beginners to pros.

See why 2/3 of Plesk servers use it.

 
LVL 17

Author Comment

by:anandkp
ID: 7205060
Hi CFXpert,

Thanx for the comment ...

what i wanted to know was the way in which i could proceed - had i to use cfcollection for this problem.

i dont need to rewrite me code .. its already working & site is running fine on the net.

i agree that - "don't ever make things more complex than they need to be"

but i just wanted to know - how to go abt using cf collection ... if u have a example with u - or if u can write one for the problem posted above [thou its not required in this case - I know]

pls let me know - anand@direct2s.com

thanx once again for all ur help :)

K'Rgds
Anand
0
 
LVL 5

Expert Comment

by:CFXPERT
ID: 7206032
Not a problem at all.  In my spare time I'll write some examples up for you to try out.

:)

KWK
0
 
LVL 17

Author Comment

by:anandkp
ID: 7208235
Thanx CFXpert ...

I'll await ur mails in my inbox !!!

Thanx once again ... :)

K'Rgds,
Anand
0
 
LVL 17

Author Comment

by:anandkp
ID: 7258339
Hi CFXpert -

a reminder from me ... for my earlier comment ...

I am still awiting

thanx !!!

K'Rgds,
Anand
0
 
LVL 17

Author Comment

by:anandkp
ID: 7264198
Hi CFXpert -

a reminder from me ... for my earlier comment ...

I am still awiting

thanx !!!

K'Rgds,
Anand
0
 
LVL 17

Author Comment

by:anandkp
ID: 7283489
Hi CFXpert - U Wrote

"Not a problem at all.  In my spare time I'll write some examples up for you to try out.

:)

KWK"
==================================================
I am still awiting

Thanx !!!

K'Rgds,
Anand
0

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question