Dear Magnolians
As many too, I'm trying to have my search results ordered by a field.
In my case the mgnl:content node has a "newsDate" field and I would
like to search for some expression and have the results ordered by the
value in the date field.
In one post, a very similar requirement is described:
http://www.nabble.com/ORDER-BY-clause-in-XPath-Query-using-Magnolia-to7865644.html
But the query does not seem to work for the poster.
In my case the query would be something like this:
path/to/root//element(*, mgnl:content)//*[jcr:contains(.,
'searchterm')] order by @newsDate
Of course this will not work in most cases, because the nodes returned
by the query (some subnodes containing 'searchterm') wil not have a
"newsDate" field. So I tried things like:
path/to/root//element(*, mgnl:content) order by @newsDate//
*[jcr:contains(., 'searchterm')]
or
path/to/root//element(*, mgnl:content)[jcr:contains(//*.,
'searchterm')] order by @newsDate
but of this is all illegal xpath stuff. Does anyone have the proper
solution to this problem?
Thanks!
-will
----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------