Limiting XWiki search to the current space

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Limiting XWiki search to the current space

Stephen Schaub
I would like to modify the search form in the default Toolbar to include a
checkbox "Search this space only." I think I can figure out how to do this
if someone could provide the Velocity code to obtain the name of the current
space.

Any suggestions would be appreciated!

Stephen





--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Limiting XWiki search to the current space

Ludovic Dubost

This would not work because the current space would always be 'XWiki'.
You would need to pass a param to the WebSearch page to give the current
space..
That would mean modifying the link to WebSearch by adding ?space=$doc.web

(The current space is the 'web' field in a document)

Ludovic

Stephen Schaub wrote:

> I would like to modify the search form in the default Toolbar to
> include a checkbox "Search this space only." I think I can figure out
> how to do this if someone could provide the Velocity code to obtain
> the name of the current space.
>
> Any suggestions would be appreciated!
>
> Stephen
>
>
>
> ------------------------------------------------------------------------
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>  

--
Ludovic Dubost
XPertNet: http://www.xpertnet.fr/
Blog: http://www.ludovic.org/blog/
XWiki: http://www.xwiki.com
Skype: ldubost AIM: nvludo Yahoo: ludovic




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Limiting XWiki search to the current space

Stephen Schaub
That worked for me.

I added the following to the search form in the main XWiki/Toolbar page:

<p><input type="checkbox" name="scope" value="space" checked="checked">This
space only
<input type="hidden" name="space" value="${doc.getWeb()}">

Then I revised the Main/WebSearch page to retrieve the space parameter and
modify the search SQL accordingly. Works very nicely!

Stephen


>From: Ludovic Dubost <[hidden email]>
>Reply-To: [hidden email]
>To: [hidden email]
>Subject: Re: [xwiki-users] Limiting XWiki search to the current space
>Date: Sat, 03 Sep 2005 20:11:20 +0200
>
>
>This would not work because the current space would always be 'XWiki'. You
>would need to pass a param to the WebSearch page to give the current
>space..
>That would mean modifying the link to WebSearch by adding ?space=$doc.web
>
>(The current space is the 'web' field in a document)
>
>Ludovic
>
>Stephen Schaub wrote:
>>I would like to modify the search form in the default Toolbar to include a
>>checkbox "Search this space only." I think I can figure out how to do this
>>if someone could provide the Velocity code to obtain the name of the
>>current space.
>>
>>Any suggestions would be appreciated!
>>
>>Stephen
>>
>>
>>




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Limiting XWiki search to the current space

cburleso

Could you please share the code of the changes to the main search page that look for the parameter whjen you get time?

==================================
Cody Burleson





"Stephen Schaub" <[hidden email]>

09/03/2005 02:34 PM

Please respond to
[hidden email]

To
[hidden email]
cc
Subject
Re: [xwiki-users] Limiting XWiki search to the current space





That worked for me.

I added the following to the search form in the main XWiki/Toolbar page:

<p><input type="checkbox" name="scope" value="space" checked="checked">This
space only
<input type="hidden" name="space" value="${doc.getWeb()}">

Then I revised the Main/WebSearch page to retrieve the space parameter and
modify the search SQL accordingly. Works very nicely!

Stephen


>From: Ludovic Dubost <[hidden email]>
>Reply-To: [hidden email]
>To: [hidden email]
>Subject: Re: [xwiki-users] Limiting XWiki search to the current space
>Date: Sat, 03 Sep 2005 20:11:20 +0200
>
>
>This would not work because the current space would always be 'XWiki'. You
>would need to pass a param to the WebSearch page to give the current
>space..
>That would mean modifying the link to WebSearch by adding ?space=$doc.web
>
>(The current space is the 'web' field in a document)
>
>Ludovic
>
>Stephen Schaub wrote:
>>I would like to modify the search form in the default Toolbar to include a
>>checkbox "Search this space only." I think I can figure out how to do this
>>if someone could provide the Velocity code to obtain the name of the
>>current space.
>>
>>Any suggestions would be appreciated!
>>
>>Stephen
>>
>>
>>




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Limiting XWiki search to the current space

Stephen Schaub
Sure -- I posted the code in the XWiki UserSnipplets:

http://www.xwiki.org/xwiki/bin/view/Dev/UserSnipplets

Here's the direct link:

http://www.xwiki.org/xwiki/bin/view/Dev/SearchThisSpace

Hope it works for you...

Stephen


>From: Cody Burleson <[hidden email]>
>Reply-To: [hidden email]
>To: [hidden email]
>Subject: Re: [xwiki-users] Limiting XWiki search to the current space
>Date: Sat, 3 Sep 2005 16:05:09 -0400
>
>Could you please share the code of the changes to the main search page
>that look for the parameter whjen you get time?
>
>==================================
>Cody Burleson
>
>
>
>
>
>
>"Stephen Schaub" <[hidden email]>
>09/03/2005 02:34 PM
>Please respond to
>[hidden email]
>
>
>To
>[hidden email]
>cc
>
>Subject
>Re: [xwiki-users] Limiting XWiki search to the current space
>
>
>
>
>
>
>That worked for me.
>
>I added the following to the search form in the main XWiki/Toolbar page:
>
><p><input type="checkbox" name="scope" value="space"
>checked="checked">This
>space only
><input type="hidden" name="space" value="${doc.getWeb()}">
>
>Then I revised the Main/WebSearch page to retrieve the space parameter and
>
>modify the search SQL accordingly. Works very nicely!
>
>Stephen
>
>
> >From: Ludovic Dubost <[hidden email]>
> >Reply-To: [hidden email]
> >To: [hidden email]
> >Subject: Re: [xwiki-users] Limiting XWiki search to the current space
> >Date: Sat, 03 Sep 2005 20:11:20 +0200
> >
> >
> >This would not work because the current space would always be 'XWiki'.
>You
> >would need to pass a param to the WebSearch page to give the current
> >space..
> >That would mean modifying the link to WebSearch by adding ?space=$doc.web
> >
> >(The current space is the 'web' field in a document)
> >
> >Ludovic
> >




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws