Skip to main content.
home | support | download

Back to List Archive

Re: [swish-e] How to search within XML tags where XML tag appears multiple times

From: David Brown <dave(at)not-real.davidhbrown.us>
Date: Thu Nov 18 2010 - 14:07:16 GMT
Can you control the query to use phrase searching?
<http://swish-e.org/docs/swish-search.html#phrase_searching>
http://swish-e.org/docs/swish-search.html#phrase_searching
 
E.g., 
swish-e -w  'name=("Tom Jones")' 
.should probably fail to return results. (Windows: swish-e -w  "name=(\"Tom
Jones\")"  )
In other words, phrase searching will almost surely achieve your request of
not matching "Tom Jones," but I expect that you *do* want to be able to
match "Tom Smith" and the documentation isn't clear on what will be placed
in the automatic metaname from child tag content. I haven't used the
UndefinedMetaTags option myself, so I'm not sure how whitespace gets munged,
but you would probably want to check whether 
swish-e -w  'name=("Tom Smith")'
.returns the expected result.
 
You might want to look at the
<http://swish-e.org/docs/swish-config.html#xmlclassattributes>
http://swish-e.org/docs/swish-config.html#xmlclassattributes
XMLClassAttributes directive to see about synthesizing a firstnamelastname
metaname.
 
If this doesn't do what you want, you'll probably need to write some XSLT or
something that will combine your names in the manner you expect them to be
searched.
 
Dave
--
Dave Brown
dave@davidhbrown.us
 
From: users-bounces@lists.swish-e.org
[mailto:users-bounces@lists.swish-e.org] On Behalf Of Tony Seddon
Sent: Thursday, November 18, 2010 7:57 AM
To: users@lists.swish-e.org
Subject: [swish-e] How to search within XML tags where XML tag appears
multiple times
 

I have an XML structure like... 

<name> 
  <first> 
    Tom 
  </first> 
  <last> 
    Smith 
  <last/> 
</name> 
<name> 
  <first> 
    Bob 
  </first> 
  <last> 
    Jones 
  <last/> 
</name> 
<name> 
  <first> 
    Jim 
  </first> 
  <last> 
    Farmer 
  <last/> 
</name> 

In the config I have UndefinedMetaTags auto 

If I search for Tom Jones using... 
 swish-e -w  "name=(Tom Jones)"   
It matches the XML above although it should not. 

How can I devise a search that will not match Tom Jones in the above XML ?



_______________________________________________
Users mailing list
Users@lists.swish-e.org
http://lists.swish-e.org/listinfo/users
Received on Thu Nov 18 09:08:20 2010