Hi,
 
 
In jackrabbit, How to search a keyword in a xml file using jcr:contains() Xpath query without interfering xml node?
 
Eg: I have a content property in a blog entry node 'book'. content is represented as xml file (<j2ee>Introduction to x design pattern</j2ee>). If I search a word 'j2ee', its returning the node which is not currect conceptually.
 
Please suggest me the possible approch either to use 'regular expression' or alternative way to resolve this requirement.
 
//Keyword search

StringBuffer queryStr =

new StringBuffer();

queryStr.append(

"//book[jcr:contains(@bookContent,'");

queryStr.append(

"j2ee"); 

//queryStr.append("j??e");

queryStr.append("')]");

Query query = queryManager.createQuery(queryStr.toString(), Query.XPATH);

QueryResult queryResult = query.execute();

 

Regards, Riyaz