You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Juan Pereyra <ju...@globant.com> on 2009/07/24 20:58:10 UTC
Query results ordered by path
Hi guys,
A quick question for you. We were using path elements to describe the names of some of our nodes, for instance, we have a category tree which is directly mapped to a subtree in the repository. However, we are facing the need to retrieve categories ordered by name, that is, by path. We haven't explicitly set a separante name property, since every rename operation is for us, a move operation. The problem is, we cannot "order by" path, since it's a pseudo-property, we are also using OCM and I was trying to solve the problem using SQL queries, which are not supported by OCM, afaik. So, is it possible to get results ordered by paths? orderable children might help? Any other advice is more than welcome. The categories are not that much of a problem, we could order them in our up without too much hassle, but there are other types of entities which should be paginated and so on...
Many thanks!
Juan
Re: Query results ordered by path
Posted by Alexander Klimetschek <ak...@day.com>.
On Fri, Jul 24, 2009 at 8:58 PM, Juan Pereyra<ju...@globant.com> wrote:
> A quick question for you. We were using path elements to describe the names of some of our nodes, for instance, we have a category tree which is directly mapped to a subtree in the repository. However, we are facing the need to retrieve categories ordered by name, that is, by path. We haven't explicitly set a separante name property, since every rename operation is for us, a move operation. The problem is, we cannot "order by" path, since it's a pseudo-property, we are also using OCM and I was trying to solve the problem using SQL queries, which are not supported by OCM, afaik. So, is it possible to get results ordered by paths? orderable children might help? Any other advice is more than welcome. The categories are not that much of a problem, we could order them in our up without too much hassle, but there are other types of entities which should be paginated and so on...
Ordering by path is not possible with either JCR Xpath or SQL. But I
think the results should be ordered by path if you set
respectDocumentOrder=true in the search index configuration:
http://wiki.apache.org/jackrabbit/Search
Regards,
Alex
--
Alexander Klimetschek
alexander.klimetschek@day.com