Skip to main content.
home | support | download

Back to List Archive

Re: XML attributes

From: Bill Moseley <moseley(at)not-real.hank.org>
Date: Fri Oct 01 2004 - 00:00:45 GMT
On Thu, Sep 30, 2004 at 04:52:35PM -0700, Roy Tennant wrote:
> 
> <site url="http://somewhere.com/">
>        <more_stuff>ljljk</more_stuff>
> </site>


> 
> My conf looks like this:
> 
> IndexOnly .x
> IndexContents XML* .x
> UndefinedXMLAttributes index
> MetaNames site.url more_stuff
> PropertyNames site.url more_stuff
> 
> but when I "swish-e -w more_stuff=ljljk -x "<site.url>\n" -f my.index" 
> I don't get what I'm looking for. Clearly I don't understand how 
> attributes are handled. All I'm need to do is to return the value of 
> the attribute in the search results. Thanks,

Not to get too deep, but what are you looking for?



moseley@bumby:~$ cat c
DefaultContents XML*
UndefinedXMLAttributes index
MetaNames site.url more_stuff
PropertyNames site.url more_stuff

moseley@bumby:~$ cat 1.xml 
 <site url="http://somewhere.com/">
       <more_stuff>ljljk</more_stuff>
 </site>

 

moseley@bumby:~$ swish-e -c c -i 1.xml -T indexed_words properties -v0
    Adding:[1:site.url(10)]   'http'   Pos:3  Stuct:0x1 ( FILE )
    Adding:[1:site.url(10)]   'somewhere'   Pos:4  Stuct:0x1 ( FILE )
    Adding:[1:site.url(10)]   'com'   Pos:5  Stuct:0x1 ( FILE )
    Adding:[1:more_stuff(11)]   'ljljk'   Pos:8  Stuct:0x1 ( FILE )
          swishdocpath: 6 (  5) S: "1.xml"
          swishdocsize: 8 (  4) N: "93"
     swishlastmodified: 9 (  4) D: "2004-09-30 16:54:51 PDT"
              site.url:12 ( 21) S: "http://somewhere.com/"
            more_stuff:13 (  5) S: "ljljk"

moseley@bumby:~$ swish-e -w more_stuff=ljljk -x '<site.url>\n'
# SWISH format: 2.5.1
# Search words: more_stuff=ljljk
# Removed stopwords: 
# Number of hits: 1
# Search time: 0.017 seconds
# Run time: 0.038 seconds
http://somewhere.com/
.



-- 
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
   swish-e@sunsite.berkeley.edu
Received on Thu Sep 30 17:00:57 2004