jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Amir Mistric" <amist...@nemours.org>
Subject RE: XPath difference in queries
Date Wed, 20 Jun 2007 14:47:14 GMT
So If someone enters in a form field a query string "rock AND roll OR disco -techno" 
I cannot just use it in jcr:contains - I have to tokenize the string and use multiple jcr:contains.
SO instead of:

jcr:contains(.,'rock AND roll OR disco -techno')

I have to do:

jcr:contains(.,'rock') and jcr:contains(.,'roll') or jcr:contains(.,'disco') and not jcr:contains(.,'techno')

Is that correct?
If, so are there any utilities that would take a natural query and produce a valid xpath?


Thanks
 
Amir
 

> -----Original Message-----
> From: Marcel Reutegger [mailto:marcel.reutegger@gmx.net] 
> Sent: Wednesday, June 20, 2007 10:01 AM
> To: users@jackrabbit.apache.org
> Subject: Re: XPath difference in queries
> 
> Amir Mistric wrote:
> > Does this mean if I have a form in which user is entering 
> search query 
> > I don't have to "build" (tokenize, validate, reconstruct, etc, etc) 
> > the XPAth query... I can just pass in something like
> > 
> > jcr:contains(.,'rock AND roll OR disco -techno') and it will work?
> 
> no, that doesn't work you have to create a valid XPath statement.
> 
> > Would I have to take care of the last point (escape special 
> chars) or 
> > is that done automatically?
> 
> you have to do that manually.
> 
> regards
>   marcel
> 
Mime
View raw message