How to search articles on space by XWQL ?
For example:
In the Sandbox space, here are 3 articles:
http://...com/bin/view/Sandbox/TestPage1
http://...com/bin/view/Sandbox/TestPage2
http://...com/bin/view/Sandbox/Test3
so, how to search the articles title begin with TestPage? and the result is: (not contains Test3)
http://...com/bin/view/Sandbox/TestPage1
http://...com/bin/view/Sandbox/TestPage2
there is a quite extensive documentation for xwql available here.
Also you can use the like operator as you would in normal SQL, e.g. where doc.Name like 'TestPage%' and doc.Space='Sandbox'
To be honest, I was not able to test the query, so it could need a little tweaking.
{{velocity}} #set($xwql = âfrom XWikiSpace as space where doc.space = âSandboxâ and doc.name like âTestPage%ââ) #set($results = $services.query.xwql($xwql).addFilter(âuniqueâ).execute()) #if($results.empty) #else #foreach ($item in $results) #set($faq = $xwiki.getDocument($item))
* [[${faq.display(âquestionâ).replace("
thanks for the hint. I already use the extension. The problem was more of âI donât have access to my serverâ (because I was in the on the way) than âI have no clue how to test thisâ.
part? You are not referencing âspaceâ anywhere in your query and although it looks strange at the beginning where a=b is a complete xwql query. See this chapter for an explanation of the expansion of the short form.