Thanks for this post Tom, I have been looking for a solution of how to implement this for ages, turning to the JSR documentation which never really helped me. I know its simple xquery, but i have never really had much time to learn it.
I'm sure it'll help many people who i know had similar problems Dieter Magnolia - User mailing list wrote: > > I've got a better handle on this now, and the issue lies in the way > Magnolia stores multivalue properties. It is in the > i.m.c.gui.control.Save.processMultiple() method. Instead of it being a > true JSR-170 multivalue property it is a node with multiple properties > on it. Because of that the query has to be on the subnode. For an > example, if you have a multivalue property called "subjects" and you > wanted to filter only nodes that had a subject of "Magnolia" you would > write: > > //[EMAIL > PROTECTED]:primaryType='mgnl:content']/*[jcr:contains(subjects,'Magnolia') > ] > > As opposed to doing @subjects. > > Further on I can add a second field as an or like this: > > //[EMAIL > PROTECTED]:primaryType='mgnl:content']/*[jcr:contains(subjects,'Magnolia') > and jcr:contains(authors,'Tom Jensen')] > > So now that I have that query, I'd like to add on additional filtering > based on content in the page, but I'm not sure if it is even possible. > From what I understand, if I were to add a predicate at the end of one > of these statements, I would be querying on values below 'subjects' or > 'authors' depending on which matched, and not the content that I have > under a node called contentParagraphs. It would seem to need to be > something like this visually: > > //[EMAIL > PROTECTED]:primaryType='mgnl:content']/*[jcr:contains(subjects,'Magnolia') > ] > /*[jcr:contains(.,'some other > text')] > > From everything that I've been able to read about XQuery, and what is > available in JSR-170, I'm not able to determine how one might write that > in a single statement. Does anyone know if it is possible, and if so > could you please give me a hint? > > Thanks, > > Tom > > -----Original Message----- > From: [email protected] [mailto:[EMAIL PROTECTED] > Sent: Monday, May 15, 2006 3:41 PM > To: [email protected] > Subject: Re: [magnolia-user] searching > > Sorry when I said "particular subject" I meant to say particular value > for that property. > > -----Original Message----- > From: [email protected] [mailto:[EMAIL PROTECTED] > Sent: Monday, May 15, 2006 3:00 PM > To: [email protected] > Subject: [magnolia-user] searching > > I'm trying to get my brain wrapped around the search functionality and > there is a gap in my understanding that I'm not sure how to close > despite reading through the JSR-170 and looking at XQuery. Here's what > I'm trying to do: > > I have a property on a page that has multiple values. I need to search > through the pages to get ones that have a particular subject. Based on > the JSR-170, I'm not sure how to setup the query because the property on > the page actually is a subnode in jackrabbit, with the properties of > that being the values I want to filter on. Is there a way around this? > > Thanks, > > Tom > > ---------------------------------------------------------------- > for list details see > http://www.magnolia.info/en/magnolia/developer.html > ---------------------------------------------------------------- > > ---------------------------------------------------------------- > for list details see > http://www.magnolia.info/en/magnolia/developer.html > ---------------------------------------------------------------- > > ---------------------------------------------------------------- > for list details see > http://www.magnolia.info/en/magnolia/developer.html > ---------------------------------------------------------------- > > -- View this message in context: http://www.nabble.com/searching-tf1623565.html#a11210534 Sent from the Magnolia - User mailing list archive at Nabble.com. ---------------------------------------------------------------- for list details see http://documentation.magnolia.info/docs/en/editor/stayupdated.html ----------------------------------------------------------------
