[xwiki-devs] Search inside page source
Hi XWIKI Team, Please, is there any way to make a search inside page sources. I need to search for a word inside page sources in the Space "Main". Even by a query on the database. Thanks in advance. Best Regards, Walid YAICH
On Mon, Feb 9, 2015 at 6:07 PM, walid yaich <[email protected]> wrote:
Hi XWIKI Team,
Please, is there any way to make a search inside page sources.
Of course. The search text input from the top of the page does this by default. Have you tried to use it? Make sure the pages you are looking for are not hidden, otherwise configure your user profile preferences to show hidden pages.
I need to search for a word inside page sources in the Space "Main".
Even by a query on the database.
This is possible too. If I search for "query" on http://www.xwiki.org the first result is about the "Query Module". Did you try to use it? Hope this helps, Marius
Thanks in advance.
Best Regards, Walid YAICH _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
Thanks, this was helpful but i still can't get it work. as i'm can't install module on this server, i tried with velocity Macro with following this http://platform.xwiki.org/xwiki/bin/view/DevGuide/velocityHqlExamples Would you please advise about how to build the query I want to use this Macro #set($hql = "<query here>") #set($results = $xwiki.searchDocuments($hql, 5, 0)) #foreach ($item in $results) * $item #end with this query : where space == 'Main' and 'document.content.source like '%str%' Please, can anyone help me to translate this query to HQL ? Am i doing wrong? Thanks in advance. 2015-02-10 9:54 GMT+01:00 Marius Dumitru Florea < [email protected]>:
On Mon, Feb 9, 2015 at 6:07 PM, walid yaich <[email protected]> wrote:
Hi XWIKI Team,
Please, is there any way to make a search inside page sources.
Of course. The search text input from the top of the page does this by default. Have you tried to use it? Make sure the pages you are looking for are not hidden, otherwise configure your user profile preferences to show hidden pages.
I need to search for a word inside page sources in the Space "Main".
Even by a query on the database.
This is possible too. If I search for "query" on http://www.xwiki.org the first result is about the "Query Module". Did you try to use it?
Hope this helps, Marius
Thanks in advance.
Best Regards, Walid YAICH _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
On 02/09/2015 05:07 PM, walid yaich wrote:
Hi XWIKI Team,
Please, is there any way to make a search inside page sources. I need to search for a word inside page sources in the Space "Main".
Even by a query on the database.
You want to look into the "content" attribute of the page. I guess this would look somewhat like: {{velocity}} #set($queryStr = "where doc.space='Main' and doc.content like '%{{velocity%'") #set($query = $services.query.xwql($queryStr)) #foreach($res in $query.execute()) * [[$res||queryString="viewer=code"]] #end {{/velocity}} this shows all pages that contain a velocity macro (kinda), by searching the content for '{{velocity' hope this hepls clemens
Merci beaucoup :) Bonne journée 2015-02-11 16:16 GMT+01:00 Clemens Klein-Robbenhaar < [email protected]>:
On 02/09/2015 05:07 PM, walid yaich wrote:
Hi XWIKI Team,
Please, is there any way to make a search inside page sources. I need to search for a word inside page sources in the Space "Main".
Even by a query on the database.
You want to look into the "content" attribute of the page.
I guess this would look somewhat like:
{{velocity}} #set($queryStr = "where doc.space='Main' and doc.content like '%{{velocity%'") #set($query = $services.query.xwql($queryStr)) #foreach($res in $query.execute()) * [[$res||queryString="viewer=code"]] #end {{/velocity}}
this shows all pages that contain a velocity macro (kinda), by searching the content for '{{velocity'
hope this hepls
clemens _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
participants (3)
-
Clemens Klein-Robbenhaar -
Marius Dumitru Florea -
walid yaich