[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Problems Displaying Verity Collection Items After Search

Posted on 2003-11-12
3
Medium Priority
?
213 Views
Last Modified: 2013-12-24
I posted a message earlier about the Verity Collection problems i was having.  I have tried another way and I now have a different problem!

At the top of my search I have the following value:
5 advertisement(s) matched your query.

This obviously means that the search has found records matching the criteria i entered.  However the search refuses to display the results and i get this error:

Variable EXPIRYDATE is undefined.

you can replace the variable EXPIRYDATE with any of the table variables in my database - it's all the same.

here is my code:

<cfsearch collection="adVerityCollection" name="findAds" criteria="#keywords#">
      <CFIF findads.RecordCount GT 0>
      <CFoutput query = "findAds">
      <B>#findads.RecordCount#</B> advertisement(s) matched your query.
            <P>
            <a href="advertdetails.cfm?adnum=#key#">#expirydate#</a><BR>
      </CFOUTPUT>
      <CFELSE>
      Sorry, No records were returned from your request.
      </CFIF>

here is the code which i used to update the verity collection:

 <cfquery name="get_db_info" datasource="advertisements">
      select *
       from ads
  </cfquery>

<cfindex query="get_db_info"
            collection="adVerityCollection"
            action="update"
            type="custom"
            key="adnumber"
            title="adverttitle"
            body="sellername, adverttitle, emailaddress, dateentered, expirydate, advertisementcontents, category, region">

  Your Collection has been updated.

------

The collection updates without any problems and as i said earlier the search is obviously finding records matching the entered criteria - it's just that it doesnt display any of the fields which are in the database table which i thought i had set up correctly with the update verity code.

Cheers
0
Comment
Question by:crazy_diamond
[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
3 Comments
 
LVL 4

Accepted Solution

by:
procept earned 120 total points
ID: 9753303
Hi,

with verity seaches you can only output the verity fields, not the DB fields. The verity fields usually are
CUSTOM1, CUSTOM2, KEY, RECORDSSEARCHED, SCORE, SUMMARY, TITLE, URL.

To use the custom fields, you can assign field names to the custom attributes (here I moved the expirydate from the body to custom field 1):

<cfindex query="get_db_info"
            collection="adVerityCollection"
            action="update"
            type="custom"
            key="adnumber"
            title="adverttitle"
            body="sellername, adverttitle, emailaddress, dateentered, advertisementcontents, category, region"
            custom1="expirydate">

But, custom fields are not searched in simple queries! If you want to search for the expirydate, you must have it in body, too.

HTH,

Chris


0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

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