View Full Version : Exclude meta tags from text snippet

04-29-2004, 09:43 AM

Is there an easy way to modify the script so that the content in the 'Description' meta tag does not appear in the text snippets?

I don't mean to exclude it from the indexing process, but only to not store its value in the text_context file...

I'm trying to use the search engine with a multilingual dynamic site, and I'm using the description meta tag to store the language of the pages being indexed, so that later I can search for documents with a given language in their descriptions...

however I would like this meta information not to be shown in the text snippet, because it's a little confusing and also because it appears 3 times (I guess this is because I've set the title weight to 3)

Thanks in advance,


05-01-2004, 08:10 AM
Hi. Try this (http://www.phpdig.net/showthread.php?threadid=555) thread or a modification thereto.

05-02-2004, 11:14 PM
Hi Charter,

thanks, this is exactly what I was looking for

Originally posted by Charter
Thanks. The chunk of code to modify is the following found in the robot_functions.php file. Comment out whatever you don't want at the end of the text files that are stored in the text_content directory. It's the $add_text variable that adds that text to the end of the files in the text_content directory.

//weight of title and description is there
for ($itl = 0;$itl < TITLE_WEIGHT; $itl++)
$text_title .= $doc_title." ".$page_desc['content']." ";
$add_text = $text_title;
if (is_array($textalts) && isset($textalts['content'])) {
$add_text .= $textalts['content'];
if (is_array($page_keywords) && isset($page_keywords['content'])) {
$add_text .= " ".$page_keywords['content'];