Thanks I just figured it out before I received this email ;-)
Best Regards, Michael Shoener Support Staff Software Application Services, Inc. -----Original Message----- From: Alexander Klimetschek [mailto:[email protected]] Sent: Monday, September 14, 2009 11:09 AM To: [email protected] Subject: Re: Query syntax comparing against multiple property values On Fri, Sep 11, 2009 at 18:46, Michael Shoener <[email protected]> wrote: > I am trying to figure out the correct Xpath query for the following > SQL > query: > > SELECT hfs:description, hfs:formname FROM hfs:file WHERE > CONTAINS(., > 'testing') > > The above query returns all records where either the hfs:description > or hfs:formname contains the value "testing". This will return all nodes that contain 'testing' somewhere (depending on the text extraction). You have to specify the properties in the contains method explicitly if you want to search only inside properties and not the whole node. The properties in the select part are only for selecting/restricting the result set, they have no influence on the where clause. In Jackrabbit, the result set will always be nodes. For xpath, this would look like this: //element(*, hfs:file)[jcr:contains(@hfs:description, 'testing') or jcr:contains(@hfs:formname, 'testing')] The result will contain nodes anyway, so to get those properties you have to call node.getProperty("hfs:description") or row.getValue("hfs:description") for each result node/row. Regards, Alex -- Alexander Klimetschek [email protected]
