Hi Ard, Thanks for your feedback.
We use the jcr:like because we want to make sure the virtual path starts with the specified path/keyword, rather than containing it. As for searching jcr:data explicitly, I did some more Google searching and it seems to me it is not quite possible. On this site http://wiki.exoplatform.org/xwiki/bin/view/JCR/Fulltext+Search , there is a section stating: "For example. We have property jcr:data (it' BINARY). Its stored well. But you will never find any string with query like: SELECT * FROM nt:resource WHERE CONTAINS(jcr:data, 'some string') Because, BINARY is not searchable by full text search on exact property." You said: jcr:contains(.,'foo') is node scope level (.) jcr:contains(jcr:data, 'foo') search in jcr:data property which seems logical and is also what we have tried, where the first works, but using jcr:data as property returns no results. As for my original question, I guess it is not possible to search in the jcr:data property only for certain keywords, which I would find most weird as in this case it is the contents (and contents only) of a document we want to search in.. which are stored in jcr:data.. hmm. Cheers, Robbert Ard Schrijvers schreef: > Hello Robbert, > > On Tue, Feb 2, 2010 at 9:24 AM, Robbert Uittenbroek > <[email protected]> wrote: > >> Hello, >> >> I have a question regarding searching (in) the jcr:data property. >> >> We store the contents of our documents in the jcr:content/jcr:data >> property. We also have added many custom properties to the jcr:content >> node, like creator, modifier, storageStatus and paths. >> >> In most search-cases, we want to search the jcr:data contents only. It >> now seems all properties are indexed by Lucene, and when we search we >> find files which have the keywords in other properties than jcr:data. >> While we do need to be able to search those properties in certain cases, >> we also want to be able to search in 'contents only', hence the jcr:data >> property. Can this be done, and if so, how? We use the xpath search >> expression, and eventhough I've seen the SQL use jcr:data (I believe) as >> field to search on, I can't seem to do this with the xpath expression. >> >> Example of the used xpath expression: >> > > First of all, I really doubt whether you want to use jcr:like. It is > really not scaling at all, let alone searching in binaries. Why aren't > you using jcr:contains? > > Futhermore, searching in a single property is as simple as defining > which property to search in the jcr:contains: > > thus: > > jcr:contains(.,'foo') is node scope level (.) > jcr:contains(jcr:data, 'foo') search in jcr:data property > > Regards Ard > > > >> /jcr:root/webplatform/www.rug.nl//element(*, >> nt:file)/jcr:content[jcr:like(@cms:virtualPathLC, '/corporate/%') and >> @cms:type and not(@cms:type='link') and not(@cms:type='folder') and >> not(@cms:type='function') and not(@cms:type='metadata') and >> jcr:contains(., 'zernike')]/(rep:excerpt()|@cms:type) order by >> jcr:score() descending >> >> Any help on this matter would be appreciated. >> >> Kinds Regards, >> >> Robbert Uittenbroek >> >> >> -- Robbert M. Uittenbroek Webdeveloper Rijksuniversiteit Groningen Donald Smits Centrum voor Informatie Technologie Applicatieontwikkeling Zernikeborg Nettelbosje 1 9747 AJ Groningen Tel. 050 363 9298 http://www.rug.nl/cit --
