jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Thompson" <elephant...@gmail.com>
Subject Pattern matching in queries
Date Tue, 03 Jul 2007 21:55:14 GMT
Hello, list:

I'm trying to implement a filtered search on a repository that has a
structure looking like

/folder/type alpha 1/node1
/folder/type alpha 1/node2
/folder/type beta 2/node3
/folder/type beta 2/node4

I tried the following, but it didn't work.

SELECT * FROM my:nodeType WHERE jcr:path LIKE '%type alpha%'
SELECT * FROM my:nodeType WHERE jcr:path LIKE '/%type alpha%/%'
SELECT * FROM my:nodeType WHERE jcr:path LIKE '%/type alpha%/%'

Due to the existing data in the repository, I can't easily come up with the
entire name at the "type alpha 1" level, so I'm trying to come up with a way
to match part of the name of the element at that level.

I've also tried some XPath queries like

//*/element(beta, my:nodeType)[1]

but I don't have any experience with XPath, so I'm not really sure how to
express what I'm looking for.

Is it even possible to do pattern matching on JCR path elements?

Thanks,

Brian

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message