jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ard Schrijvers" <a.schrijv...@hippo.nl>
Subject RE: FullText Search Problem
Date Thu, 29 Nov 2007 19:39:37 GMT

> hi users,
> i want to make a fulltext search like this ...
> /jcr:root/tirolgvat[1]//element(*, nt:base)[jcr:contains(., 'test!')]
> then i get this exception...
> javax.jcr.RepositoryException: Exception building query: 
> org.apache.jackrabbit.core.query.lucene.fulltext.ParseExceptio
> n: Encountered "<EOF>" at line 1, column 6.

Yes, you are correct. It seems that in LuceneQueryBuilder at

Object visit(TextsearchQueryNode node, Object data) {

it breaks at

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

where the parser is o.a.j.core.query.lucene.fulltext.QueryParser. It
seems to break on string ending with a "!". Unfortunately, I do not have
insight in how the QueryParser works. Perhaps somebody else knows where
to look in the QueryParser .

OTOH, beside that this is possibly a bug, what are you trying to achieve
with your query? "jcr:contains(., 'test!')", even when it would not
break will simple return the same as "jcr:contains(., 'test')". This is
because the query is eventually parsed with a lucene analyzer, and
string are tokenized on "!" (at least if your analyzer sees ! as a
delimiter , which the default analyzer in jackrabbit does, which you are
probably using). So assuming you use
org.apache.lucene.analysis.standard.StandardAnalyzer (see [1] workspace

1) 'test!' is equal to 'test' 
2) 'te!st' is equal to 'te' OR 'st' (the or is depending on default OR
or AND setting though)
3) 'te#st' is equal to 'te' OR 'st'

You might think it is strange, but you have to realize that you text is
also indexed with this same analyzer.

Hope it is clear,'

Regards Ard

[1] http://jackrabbit.apache.org/doc/config.html

> i know the problem is the "!" sign
> i tried to encode it first with the ISO9075 Class but then 
> the query works but i get no results
> any hints are welcome :-)
> BR,
> claus

View raw message