jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mabogunje <amabogu...@primavera.com>
Subject Support for lucene query syntax in jcr:contains()
Date Mon, 14 Apr 2008 14:04:55 GMT

Is there full support for the lucene query syntax ... my scenario is as
follows :

I have the following code snippet :

  .....
  QueryManager queryManager = session.getWorkspace().getQueryManager();
  Query query = queryManager.createQuery(queryString, Query.XPATH);
  QueryResult result = query.execute();

When queryString is as follows :

//*[@jcr:primaryType = 'prm:File' and (jcr:contains(jcr:content, 'blood
!smell') or jcr:contains(@prm:Title, 'blood !smell'))] order by jcr:score()
descending

The result is as expected (it returns all documents that contain blood but
not smell in either the title or contents.

However changing the "!" to "NOT" changes the results. so when the query is
:

//*[@jcr:primaryType = 'prm:File' and (jcr:contains(jcr:content, 'blood NOT
smell') or jcr:contains(@prm:Title, 'blood NOT smell'))] order by
jcr:score() descending

I do not get the same results.

Even though ! or NOT are valid in regular lucene, that does not seem to be
the case when used in a jcr:contains function ... is that true ? if so is
there another where to run a pure lucene query ?
-- 
View this message in context: http://www.nabble.com/Support-for-lucene-query-syntax-in-jcr%3Acontains%28%29-tp16678088p16678088.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Mime
View raw message