0
votes

I am using jackrabbit 2.6 and I have the following nodes structure

[nt:file]  
  |-- [nt:file]
         |-- [nt:resource]

In nt:resource nodetype there is property "jcr:data" with the stream of the file that I want to save.

I do not know how to create the query in order to retrieve all nt:resource nodes by content.

If did this query

select * from [nt:resource] as r 
where contains(r.[jcr:content], '*tristique*')

but it returns an empty result. What am I missing ? Is the search-by-content enabled by default in jackrabbit ?

Thanks

1

1 Answers

0
votes

It seems that jackrabbit was not indexing plain text files because the encoding was not persisted.

I added:

node.setProperty(JcrConstants.JCR_ENCODING, encoding);

and now text files are indexed and full text search works fine.