Subject: [htdig] Re: need help with htdig...
From: Gilles Detillieux (email@example.com)
Date: Fri Jan 12 2001 - 09:54:51 PST
According to Ran Kenig:
> I spotted your email on one of the answers in the htdig.org site and I
> thought maybe you could help me.
The archives you were most likely looking at were those of the
firstname.lastname@example.org mailing list. That is where questions of this sort
should be asked. See http://www.htdig.org/FAQ.html#q1.16
> I'm creating this simple site search engine using htdig.
> My problem is that the description that return with the page is only its
> All our titles are the same so the list of files are all the same, so I
> would like to show the meta description instead.
> Maybe I'm doing something wrong but I've added these to the config file:
> - use_meta_description: true
> - keywords_meta_tag_names: keywords description title
> - title_factor: 0
> I recreate the DB's and nothing changed.
> you can see the search page in: http://www.lsvl.net/home_search.html
> Can you help me ???
The use_meta_description attribute gets htsearch to use the meta
description in place of the document excerpt, not in place of the title.
Also, the keywords_meta_tag_names is for specifying which meta tags will
be parsed as keywords, and added to the word database according to the
keyword_factor. As meta description text is already added to the word
database according to the meta_description_factor, there's really no
point in listing "description" in keywords_meta_tag_names. Finally,
setting title_factor to 0 will prevent the words in the title from
bearing any weight in the search, but it won't prevent the titles from
showing up on the results page, because the templates still use them.
So, none of the 3 attribute settings is particularly appropriate for
what you're trying to accomplish.
I tried a search at your search page above and got this error:
The requested URL /cgi-bin/hierArrays.js was not found on this server.
So, there's apparently another configuration problem you need to deal
with as well. You shouldn't use relative file name references in your
htsearch templates, because they're interpreted relative to the directory
in with htsearch is found, not the one in which the templates are found.
If you want the meta descriptions to replace the titles, first of all
you should set use_meta_description back to false, because you don't
want the descriptions to appear as both the title and as the text.
Next, you should apply this patch to htsearch/Display.cc, so you can
use the meta description in the result templates:
--- htsearch/Display.cc.orig Thu Feb 17 10:43:28 2000
+++ htsearch/Display.cc Fri Jan 12 11:12:13 2001
@@ -273,6 +273,7 @@ Display::displayMatch(ResultMatch *match
+ vars.Add("METADESCRIPTION", new String(ref->DocMetaDsc()));
vars.Add("SCORE", new String(form("%d", match->getScore())));
vars.Add("CURRENT", new String(form("%d", current)));
char *title = ref->DocTitle();
Then, you'll need to uncomment the template_map definition from your
htdig.conf file, and edit the common/long.html and common/short.html
template files to use $&(METADESCRIPTION) instead of $&(TITLE).
(All of this assumes you're running version 3.1.5 of ht://Dig.)
Of course, none of this will do much good unless you consistently
have meaningful meta description tags in all the pages on your site.
As I was browsing through almost a half-dozen pages there, I didn't
come across any that did have a meta description. If you're going to
change all those pages, it seems to me it would make more sense to
put the meaninful descriptions within the <title>...</title> tags,
rather than in a <meta name="description" content="..."> tag, and
avoid all the configuration changes.
-- Gilles R. Detillieux E-mail: <email@example.com> Spinal Cord Research Centre WWW: http://www.scrc.umanitoba.ca/~grdetil Dept. Physiology, U. of Manitoba Phone: (204)789-3766 Winnipeg, MB R3E 3J7 (Canada) Fax: (204)789-3930
------------------------------------ To unsubscribe from the htdig mailing list, send a message to firstname.lastname@example.org You will receive a message to confirm this. List archives: <http://www.htdig.org/mail/menu.html> FAQ: <http://www.htdig.org/FAQ.html>
This archive was generated by hypermail 2b28 : Fri Jan 12 2001 - 10:08:49 PST