Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbee problem with Verity

Status
Not open for further replies.

OccasionalCoder

Technical User
Sep 26, 2005
36
US
This is the first time I've tried setting up the Verity Search Engine.

Here's my code for indexing:
------------------
<cfquery name="content" datasource="#db#" username="#un#" password="#pw#">
select
content_id, page_title, content
from
content
</cfquery>

<cflock name="consortiumres" timeout="120">
<cfindex collection="consortiumres"
action="refresh"
type="custom"
body="page_title,content"
key="content_id"
title="page_title"
Query="content"
>
</cflock>
----------------
and here's code for my test search page:
----------------
<cflock name="consortiumres" type="readonly" timeout="120">
<cfsearch name="results"
collection="consortiumres"
title="page_title"
key="content_ie"
type="simple"
criteria="consortium"
>
</cflock>
<table border="0" cellpadding="3" width="100%">
<tr>
<td>score</td>
<td>Page</td>
</tr>
<cfoutput query="results">
<tr>
<td>#score#</td>
<td><strong>#page_title#</strong><br>#summary#</td>
</tr></cfoutput>
</table>
-----------------

When I execute the searchpage, it get a "Variable Page_title is undefined" error. I'm confused, because I did define Page_title in the index and in the search code.

Your help is greatly appreciated
 
From the code you posted, where did you define "page_title"? And, on what page(s) did define the var "page_title"


____________________________________
Just Imagine.
 
I must be totally confused on this...

page_title comes from the query, and in the index tag title="page_title"

and in the search

title="page_title"

Doesn't this value come from the query?

Thanks
 
Are all instances of the "page_title" var coming from the dB? What happens if there is no value or no record for "page_title"?

There are few things you should know about verity:
1. When using CFINDEX you must make sure that all the fields you include in the BODY= parameters are valid fields from your query. Because at times you won’t get any
error message and your index won’t work at all

2. 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!)

BTW, i've noticed that you like to call you're var names the same thing as dB fieldnames or table names. This can be very confusing. Its ALWAYS a better idea to call you're var names different things then your dB tablenames or fieldnames.

But back to your verity issue. I've only used verity once and hated it. I think its a very bad way of having a site search option for your site. Its slow and a pain-in-the-arse to setup. I usually create my own site search tool, which is very easy to do. Anyways, take a look at this: this might help with any problems you have.


____________________________________
Just Imagine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top