Skip to main content.
home | support | download

Back to List Archive

Re: MetaName search not working, yet

From: Bill Moseley <moseley(at)not-real.hank.org>
Date: Tue Jan 29 2002 - 19:37:36 GMT
At 09:56 AM 01/29/02 -0800, Bill Moseley wrote:
>I think you can only use <meta_description> with libxml2.  If I remember
>correctly, the HTML parser thinks everything <foo> is an HTML tag.  Libxml2
>knows what are HTML tags, so when I get passed a tag (this is in parser.c)
>from libxml2, I know if it's a real HTML tag.  If not then I pretend it's a
>metaname.  That's how that hack works.  That's probably why your metanames
>are not working.

*correction*

That's how it worked in December (the part about not indexing HTML tags).

I forgot that was changed, as with libxml2 (HTML2) all tags are considered
as metatags, even HTML tags.

So you can actually do:

  metanames td

And index table contents under a different metaname.

The exception is that "UndefinedMetaTags auto" does not apply to *HTML*
tags.  
(UndefinedMetaTags auto might be used for XML files where you want to
automatically index all tags under their own metanames.  Not sure how
useful that is.)

This indexing of HTML metanames is kind of fun.  For example, you can do

MetaNames headings
MetaNameAlias headings h1 h2 h3 tr

And then a search of  ./swish-e -w headings=foo will limit that search to
the headings.

And yes, fake HTML tags like:

   <fake_meta>
        content
   </fake_meta>


only works with HTML2 parser.  All this interesting stuff only works with
the libxml2 parser.



-- 
Bill Moseley
mailto:moseley@hank.org
Received on Tue Jan 29 19:38:05 2002