Skip to main content.
home | support | download

Back to List Archive

Re: [swish-e] searching metanames and document

From: Bill Moseley <moseley(at)not-real.hank.org>
Date: Tue Nov 06 2007 - 05:21:42 GMT
On Mon, Nov 05, 2007 at 05:50:07PM -0500, Michael Peters wrote:
> Bill Moseley wrote:
> 
> > swish-e -w perl is shortcut notation for
> > swish-e -w swishdefault=perl
> > 
> > swishdefault is the metaname used if no other metaname is in active
> > for a word when indexing.
> 
> Right, but doesn't everything make it's way to swishdefault? That's what I thought

No, not for html.

> 
>   Swish also, by default, indexes content of meta tags. So 'swish-e -w foo' will
>   find "foo" in the body, the title, or any meta tags

Those are html <meta> tags -- the terminology is a bit confusing.

$ cat s.html
<html>
<head>
    <meta name="foo" content="foocontent" />
    <title>title</title>
</head>
<body>
    <p>
        bodycontent
    </p>
</body>
</html>

$ swish-e -i s.html -T indexed_words -v0
    Adding:[1:swishdefault(1)]   'foocontent'   Pos:5  Stuct:0x5 ( HEAD FILE )
    Adding:[1:swishdefault(1)]   'title'   Pos:8  Stuct:0x7 ( HEAD TITLE FILE )
    Adding:[1:swishdefault(1)]   'bodycontent'   Pos:15  Stuct:0x9 ( BODY FILE )

All indexed words must be assigned a metaname, and that is the
"swishdefault" metaname.

If "foo" is set as a metaname then the <meta> contents can be indexed
under that name:

$ cat c
MetaNames foo

$ swish-e -i s.html -T indexed_words -v0 -c c
    Adding:[1:foo(10)]   'foocontent'   Pos:4  Stuct:0x85 ( META HEAD FILE )
    Adding:[1:swishdefault(1)]   'title'   Pos:8  Stuct:0x7 ( HEAD TITLE FILE )
    Adding:[1:swishdefault(1)]   'bodycontent'   Pos:15  Stuct:0x9 ( BODY FILE )


As Peter says, if you set a metaname for the outer XML tag then you
should be able to search both.


moseley@bumby:~$ cat t.xml
<a>
  <b>
    <c>foo</c>
  </b>
  <d>
    <e>bar</e>
  </d>
</a>


moseley@bumby:~$ cat c
DefaultContents XML*
Metanames a c


moseley@bumby:~$ swish-e -i t.xml -T indexed_words -v0 -c c
    Adding:[1:a(10)]   'foo'   Pos:4  Stuct:0x1 ( FILE )
    Adding:[1:c(11)]   'foo'   Pos:4  Stuct:0x1 ( FILE )
    Adding:[1:a(10)]   'bar'   Pos:10  Stuct:0x1 ( FILE )


-- 
Bill Moseley
moseley@hank.org

Unsubscribe from or help with the swish-e list: 
   http://swish-e.org/Discussion/

Help with Swish-e:
   http://swish-e.org/current/docs

_______________________________________________
Users mailing list
Users@lists.swish-e.org
http://lists.swish-e.org/listinfo/users
Received on Tue Nov 6 00:21:41 2007