Hi Eron ,
Thank you for your hint. When I manually enter a word as the criteria in the
search tag it works. So I deleted the whole search form and start a very
simple form to make sure the Form.Criteria is submitted properly. And it
works perfect.

Now, the problem is my search should allow the user to select different type
to narrow the results. So when I add some more selections to the form

The old problem comes back again. Now I send you all the code for your
advice.

Here is the code in the search file:

<cfif Isdefined("Form.all")>
  <!--- "All" is a checkbox field. If "All" is selected then ingnore any
type just matches the form.Criteria --->
 <cfset  TheCriteria="#Form.Criteria#">

 <!--- If "All is not selected --->
<cfelse>
 <cfif Isdefined("Form.ItemType")>

 <!--- " ItemType" is a checkbox  field which allows multiple selections.
 If "ItemType" is defined then set TheCriteria eq the ItemType in the field
matches the Form.Criteria --->

<cfset TheCriteria="(cf_custom2 <matches>
        #Form.ItemType#)And (#Form.Criteria#)">
<cfelse>
 <!--- if ItemType is not defined then just mathes the Form.Criteria --->
 <cfset TheCriteria="#Form.Criteria#">
 </cfif>
    </cfif>

 <cfoutput>#TheCriteria#</cfoutput>
<CFSEARCH COLLECTION="test"
          name="GetResults"
          CRITERIA="#TheCriteria#">

If I select All or  don't make any selection it just take the Form.Criteria
and gives me the correct result. But If I make any selection in the ItemType
it always gives me "0" results. If I select Picture and Vedio in the
Form.ItemType field and enter mother in the Form.Criteria field , then try
to print out it like:<cfoutput>#TheCriteria#</cfoutput> the result is
:(cf_custom2 'Picture','Video')And (mother) . Is it should look like this?
If it is coreect why it doesn't work in the <cfsearch> tag?


The code in the indexfile is like this:

<cfquery name="GetItems" datasource="test">
SELECT ItemID, ItemName, Short_Desc,Long_Desc, Author,Year,TopCategoryName,
SubCategoryName,SubSubCategoryName,FileName
FROM items

</cfquery>

<cfindex action="update"
collection="gleemail"
key="ItemID"
type="custom"
title="ItemName"
query="GetItems"
body="Short_Desc,Long_Desc,
Author,Year,TopCategoryName,SubCategoryName,SubSubCategoryName,FileName"
custom1="FileName"
custom2="ItemType">



Here is the code in the searchform file :

<table align="center">
<cfform action="dsp_search.cfm" method="post"><p>
<tr>
<td colspan="2">
Please enter a keyword you want to search<br>
</td>
</tr>
<tr><td colspan="2">  &nbsp </td></tr>
<tr>
<td colspan="2">
    All   <cfinput type="checkbox" name= "All" Value="All">
    Picture <cfinput type="checkbox" name = "ItemType" value="'Picture'"
checked>
    Animation <cfinput type="checkbox" name = "ItemType"
value="'Animation'">
    Video <cfinput type="checkbox" name = "ItemType" value="'Video'">
    Audio <cfinput type="checkbox" name = "ItemType" Value="'Audio'">

</td>
</tr>
 <tr><td colspan="2">  &nbsp </td></tr>

<tr>
<td colspan="2">
Please enter a keyword you want to search<br>
</td>
</tr>

<tr>
<td colspan="2">
<cfinput type="text" name="Criteria" size="30" maxlength="100"
required="yes" message="You must enter a keyword">
<input type="submit" value="Go!">
</td>
</tr>
</cfform>

</table>

Thank you again for your help.


----- Original Message -----
From: Eron Cohen <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, May 26, 2000 3:59 PM
Subject: RE: verity search problem


> Sima,
>
> What happens when you manually type in a search word that you know must
> exist in your collection?
>
> Can you post the rest of the code you're using?
>
> Eron
>
> PS-  There have been alot of helpful posts regarding verity recently.  I
> don't have any of others handy, but here's some information I posted a few
> weeks ago that may help you:
>
>
> 1)  The verity search engine built into CF is somewhat stripped down from
> the full version.  Although, as I have learned from posts on this forum,
the
> version that comes with Cold Fusion is full of "undocumented features"
that
> coincidently turn out to be features in the full version :-O
>
> 2)  To say the least, Verity can be weird.
>
> I've definitely had my share of problems with Verity.  Probably the worst
> one of all is that it doesn't tell you when there's an error...it just
> doesn't work.  Here are a couple of other points from my presentation that
> may help (If you do go looking for the entire presentation, its under PAST
> MEETINGS > February > Eron Cohen):
>
>
> --Verity searches can be CaSe sensitive.  I typically force keyword
searches
> into lower case.
>
> --When using CFINDEX you must be sure that all the fields you include in
the
> BODY= parameters are valid fields from your query.  Often you won't get an
> error message and your index won't work!
>
> And possibly the biggest GOTCHA:
>
> --**********ALWAYS make sure your KEY= field is unique for EVERY record.
If
> you don't do this, as soon as verity encounters a duplicate key it will
stop
> indexing there (and it won't give you any error messages!)***************
>
>
> 3) I have done quite a bit of indexing of large amounts of data.  I am not
> exactly sure what the limit is, but in fact, there IS a limit to the size
of
> your collections!  This is documented in Allaire's KB (article #11934).
>
> This is something you can get around because in CFSEARCH you can name more
> than 1 collection to search at the same time, so you can always break down
> what you want to search into separate collections.
>
> I recently gave a presentation about Verity searches at the Maryland Cold
> Fusion user's group.  You can download my PowerPoint slides there:
>
> http://www.cfug-md.org/meetings.cfm (February 8th 2000)
>
> -----Original Message-----
> From: Sima Lee [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 26, 2000 4:48 PM
> To: [EMAIL PROTECTED]
> Subject: Re: verity search problem
>
>
> Thank you for such a quick response. But I tried everything like the
> following and it doesn't work:
>
> CFSEARCH COLLECTION="test"
>            NAME="GetItems"
>            CRITERIA="#Form.criteria#">
>
> or
>    <CFSEARCH COLLECTION="test"
>        NAME="GetItems"
>     CRITERIA=Form.criteria>
> or
>
> <CFSEARCH COLLECTION="test"
>           NAME="GetItems"
>            CRITERIA="Form.criteria">
> They all return "0" record.
>
> Sima
>
>
>
>
> ----- Original Message -----
> From: Eron Cohen <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, May 26, 2000 3:30 PM
> Subject: RE: verity search problem
>
>
> > One thing that could be wrong: I believe you actually NEED # signs for
> your
> > Criteria= statement...
> > What happens if you use:
> >
> > <CFSEARCH COLLECTION="test"
> >           NAME="GetItems"
> >           CRITERIA="#Form.criteria#">
> >
> > HTH,
> >
> > Eron
> >
> > -----Original Message-----
> > From: Sima Lee [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, May 26, 2000 4:10 PM
> > To: [EMAIL PROTECTED]
> > Subject: verity search problem
> >
> >
> > This is a multi-part message in MIME format.
> >
> > ------=_NextPart_000_0041_01BFC724.71016490
> > Content-Type: text/plain;
> > charset="iso-8859-1"
> > Content-Transfer-Encoding: quoted-printable
> >
> > Hi All,
> >
> > I am new to ColdFusion and try to use verity search . This is the =
> > problem I got:
> > I created a collection and indexed it . It says there is 8 records in it
=
> > , which is true. But when I use the cfsearch tag to search , it always =
> > gives me zero records no matter what I type in as a criteria. But if I =
> > change   Criteria=3D"" in the search tag it gives me all the 8 records.
=
> > For example:
> >
> > <CFSEARCH COLLECTION=3D"test"=20
> >           NAME=3D"GetItems"=20
> >           CRITERIA=3D"Form.criteria">
> > Will return 0 record.
> >
> > but
> > <CFSEARCH COLLECTION=3D"test"=20
> >           NAME=3D"GetItems"=20
> >           CRITERIA=3D"">
> >
> > will return all the 8 records.
> >
> > Could anybody tell me why the criteria does not work? Thanks in advance.
> >
> >
> > ------=_NextPart_000_0041_01BFC724.71016490
> > Content-Type: text/html;
> > charset="iso-8859-1"
> > Content-Transfer-Encoding: quoted-printable
> >
> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> > <HTML><HEAD>
> > <META content=3D"text/html; charset=3Diso-8859-1" =
> > http-equiv=3DContent-Type>
> > <META content=3D"MSHTML 5.00.2314.1000" name=3DGENERATOR>
> > <STYLE></STYLE>
> > </HEAD>
> > <BODY bgColor=3D#ffffff>
> > <DIV><FONT face=3DArial size=3D2>Hi All,</FONT></DIV>
> > <DIV>&nbsp;</DIV>
> > <DIV><FONT face=3DArial size=3D2>I am new to ColdFusion and try to use =
> > verity search=20
> > . This is the problem I got:</FONT></DIV>
> > <DIV><FONT face=3DArial size=3D2>I created a collection and indexed it .
=
> > It says=20
> > there&nbsp;is 8 records in it , which is true. But when I use the =
> > cfsearch tag=20
> > to search , it always gives me zero records no matter what I type in as
=
> > a=20
> > criteria. But if I change&nbsp;&nbsp; Criteria=3D"" in the search tag it
=
> > gives me=20
> > all the 8 records. For example:</FONT></DIV>
> > <DIV>&nbsp;</DIV>
> > <DIV><FONT face=3DArial size=3D2>&lt;CFSEARCH=20
> >
COLLECTION=3D"test"&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
> > bsp;&nbsp;=20
> > NAME=3D"GetItems" =
> > <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
> > CRITERIA=3D"Form.criteria"&gt;</FONT></DIV>
> > <DIV><FONT face=3DArial size=3D2>Will return 0 record.</FONT></DIV>
> > <DIV>&nbsp;</DIV>
> > <DIV><FONT face=3DArial size=3D2>but
> > <DIV><FONT face=3DArial size=3D2>&lt;CFSEARCH=20
> >
COLLECTION=3D"test"&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
> > bsp;&nbsp;=20
> > NAME=3D"GetItems" =
> > <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
> > CRITERIA=3D""&gt;</FONT></DIV>
> > <DIV>&nbsp;</DIV>
> > <DIV>will return all the 8 records.</DIV>
> > <DIV>&nbsp;</DIV>
> > <DIV>Could anybody tell me why the criteria does not work? Thanks in=20
> > advance.</DIV></FONT></DIV>
> > <DIV>&nbsp;</DIV></BODY></HTML>
> >
> > ------=_NextPart_000_0041_01BFC724.71016490--
> >
>
> --------------------------------------------------------------------------
> --
> > --
> > Archives: http://www.eGroups.com/list/cf-talk
> > To Unsubscribe visit
> > http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
or
> > send a message to [EMAIL PROTECTED] with 'unsubscribe'
in
> > the body.
> >
>
> --------------------------------------------------------------------------
> ----
> > Archives: http://www.eGroups.com/list/cf-talk
> > To Unsubscribe visit
> http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
> send a message to [EMAIL PROTECTED] with 'unsubscribe' in
> the body.
>
> --------------------------------------------------------------------------
--
> --
> Archives: http://www.eGroups.com/list/cf-talk
> To Unsubscribe visit
> http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
> send a message to [EMAIL PROTECTED] with 'unsubscribe' in
> the body.
>
> --------------------------------------------------------------------------
----
> Archives: http://www.eGroups.com/list/cf-talk
> To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
>

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to