jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dave Brosius" <dbros...@mebigfatguy.com>
Subject Re: Support for lucene query syntax in jcr:contains()
Date Thu, 17 Apr 2008 07:12:27 GMT
I traced it down into the LuceneQueryBuilder line 414, where it calls

Query context = parser.parse(query.toString());

which is a javacc method.

The input is for instance 'car NOT bus'
and the output is
+11:FULL:Title:car +11:FULL:Title:bus
However this is wrong as the input string 'car !bus'
is
+11:FULL:Title:car -11:FULL:Title:bus

Now the javacc jj file tries to handle NOT, so I'd say it is a bug.
Add a bug here, please

https://issues.apache.org/jira/secure/CreateIssue!default.jspa





----- Original Message ----- 
From: "mabogunje" <amabogunje@primavera.com>
To: <users@jackrabbit.apache.org>
Sent: Monday, April 14, 2008 9:04 AM
Subject: Support for lucene query syntax in jcr:contains()


>
> 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