Verity Search

I am trying to implement Verity Search in a project I’m working on. I have to start by saying that my knowledge about this subject, is very basic, I.E. I know how to create a collection either in the Administrator or by using the <cfcollection> tag. I known how to index, update, delete, purge, or refresh a collection and I know how to search a collection with the <cfsearch> tag, but that’s about it and this is obvious not enough for what I would like to accomplish, since I’m breaking my head over this for the last few days :headbang:

The situation is this; I’m working on a website covering activities in the Peloponnese, Greece. My main pages and related db tables are; categories.cfm (table:categories), activities.cfm (table:activities), cities.cfm (table:cities) and companies.cfm (table:companies). The content on all four pages is completely dynamic. As you understand all tables are related to eachother, I.E. the category water sport has several activities (scuba diving, water skiing, etc.), there are several companies offering water sport etc.

What I would like is that when someone using the search string scuba diving, that the result page returns everything related to scuba diving, in other words:


<!-- link to the activities page scuba diving, coming from the database -->
<a href="http://www.websitename.com/activities.cfm?id=#94#">#title#</a>
<!-- links to the companies page, with companies offering scuba diving. This is just one page with content is coming from the database depending on the id -->
<a href="http://www.websitename.com/companies.cfm?id=#150#">#title#</a>
<a href="http://www.websitename.com/companies.cfm?id=#350#">#title#</a>
<a href="http://www.websitename.com/companies.cfm?id=#1320#">#title#</a>

Another example could be, that if someone used the search string Archaeological Sites, the following results should be returned:


<!-- link to the activities page Archaeological Sites, coming from the database -->
<a href="http://www.websitename.com/activities.cfm?id=#2#">#title#</a>
<!-- links to the cities pages, that have the search string Archaeological Sites in the content (coming from the database), which is not unusual in Greece ;) --> 
<a href="http://www.websitename.com/cities.cfm?id=#1#">#title#</a>
<a href="http://www.websitename.com/cities.cfm?id=#2#">#title#</a>
<a href="http://www.websitename.com/cities.cfm?id=#3#">#title#</a>

I spent the last two nights browsing the Internet to find some useful information, and maybe it’s me, but I find the documentation covering the subject very limited. Most of the articles are very clear in the beginning but when it comes to the point where things become complicated they finish it off with just a few lines.

Some articles mention that you can’t use the normal Verity Search but you need vSpider instead. I find it all very confusing. :eek: Can someone please point me in the right direction how to set something like this up or where I can find a detailed tutorial covering this subject.

A bit of an update on this, for me no end in sight, subject. I had yet another night, trying to figure how to do this. Every time that I think I have a solution, something else is breaking me up.

At first I was thinking, to make three different collections, but that didn’t do the trick. So I brought it back to one collection again, but in that scenario I couldn’t use the Primary Key’s as the key for the collection, so for the tables activities and cities I used activity_name and city_name as key for the collection, I created a extra field in both tables called page. In the table activities this field has a default value activities.cfm and in the table cities cities.cfm. I then did a custom update for the collection using those two tables the following way:


<cfquery name="getDBinfo" datasource="#dsn#">
      select activity_id, activity_name, activity_text, page
      from activities
</cfquery>

<cfindex 	
	query="getDBinfo" 
	collection="activitiesgreece" 
	action="update" 
	type="custom" 
	key="activity_name" 
	title="activity_name"
	custom1="activity_id" 
	custom2="page" 
	body="activity_id, activity_name, activity_text, page">

<!--- Same for cities table --->

As you can see did I use the custom1 and custom2 attributes for the primary keys and the pages (as mentioned before) to link on the results page to the appropriate page with the right primary key. And on the search result page I tried to output it like this:


<cfsearch 
    name="getSearchResults" 
    collection="activitiesgreece" 
    criteria="#Form.txtSearch#">

<cfoutput query="getSearchResults">
    <a href="#custom2#?id=#custom1#">#title#</a><br>
</cfoutput>

Although this is probably not conventional, but at the time of doing it this way, I found it very smart :rolleyes:. To see if this was working I added the word Archaeological in the field city_text for 10 cities. I used Archaeological as search string which should, if everything was okay, return 11 results. One activities page ( Archaeological Sites) and the ten city pages I added the search word too. But it only returns 2 records. Indeed the Archaeological Sites activities page and just 1 city.

Does anybody see, except that is not conventional, what I’m doing wrong?

Thank you in advance

Sorry to reply to my own post, but I was to late to edit the previous one.

The 2nd message can be ignored, In other words it is working. It was completely my wrong. I forgot to update the collection after making changes in the database.

Like I said before, this is probably not the conventional way of doing this so I’m still looking forward to replies ,which can suggest a better way of doing this.

Thank you all