jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sébastien Launay <sebastien.lau...@anyware-tech.com>
Subject Re: Simple question about jcr:contains()
Date Mon, 04 Aug 2008 13:19:10 GMT
Hi Paco,

I think the Lucene analyzer used in your workspace  and defined in
repository.xml does not tokenize string as you wanted.
Indeed, the default analyzer is Lucene StandardAnalyzer [1] which
used Lucene StandardTokenizer [2] which claims to:
"Splits words at punctuation characters, removing punctuation.
However, a dot that's not followed by whitespace is considered part of a
token."

You can still use a custom analyzer by setting the class name to use
in the property "analyzer" of the SearchIndex element in repository.xml.

If the workspace is already created, you need to update
repository/workspaces/<workspaceName>/workspace.xml
and also delete the repository/workspaces/<workspaceName>/index
directory in order to reindex nodes at startup.

[1]
http://lucene.apache.org/java/2_2_0/api/org/apache/lucene/analysis/standard/StandardAnalyzer.html
[2]
http://lucene.apache.org/java/2_2_0/api/org/apache/lucene/analysis/standard/StandardTokenizer.html
--
Sébastien Launay

Paco Avila a écrit :
> I've a property called "okm:name" where I store each document name. If the
> document is called "hola mundo.txt" why the query
>
> /jcr:root//*[jcr:contains(@okm:name, 'hola')]
>
> return the document node but:
>
> /jcr:root//*[jcr:contains(@okm:name, 'mundo')]
>
> does not return anything?
>
>   

Mime
View raw message