Querying XML

2014-03-09 Thread cju
I have some XML stored in Solr that looks like this:


  


  
 
 
What I’d like to do is get a hit for this document if there’s an element in
the XML where (@name=”Bob” AND @city=”Cincinnati”). If I write something
like this, I’ll get a hit – although I’m not actually matching what I’m
looking for:
 
q=MainData.Info.Info@name:Bob AND MainData.Info.Info@city:Cincinnati
 
I want to my criteria only to match attributes within the same element, for
example:
 

  


 (only match this)
  
 
 
Is it possible to write a query to achieve this without changing my XML?



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Querying-XML-tp4122451.html
Sent from the Solr - User mailing list archive at Nabble.com.


XML with duplicate element names

2014-02-25 Thread cju
I'm trying to query XML documents stored in Riak 2.0, which has integrated
Solr. My XML looks like this.


  


  


So a search in Riak might look something like this:

q=MainData.Info.Info@name:Bob

So let's say I want to match all documents where the name="Bob" and
city="Cincinnati", for same element ... If I do something like the
following:

q=MainData.Info.Info@name:Bob AND MainData.Info.Info@city:Cincinnati

I'll get a hit - even though that's not what I'm really looking for - I want
Bob and Cincinnati matching in the same "Info" element. 

So if you take my example XML at the top of my post here, how would I write
the query to match a document where the MainData.Info.Info element has the
attributes name="Joe" and city="Cincinnati" ... or the following line:



I did try a fq, that looked like this, figuring I could filter down to the
element where name="Joe", then test to see if city="Cincinnati" - that it
didn't work:

q=MainData.Info.Info@city:Cincinnati&fq=MainData.Info.Info@name:Joe

I'm obviously a noob here, so I apologize for my noobness in advance.
Thanks!




--
View this message in context: 
http://lucene.472066.n3.nabble.com/XML-with-duplicate-element-names-tp4119679.html
Sent from the Solr - User mailing list archive at Nabble.com.