0

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

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
semantic-dev
  • 1,095
  • 3
  • 14
  • 27

1 Answers1

0

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.

semantic-dev
  • 1,095
  • 3
  • 14
  • 27