Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

How to search only in certain section of website?


Reply

7 Posts   2587 Views

Avatar
pga

8 August 2008 at 10:08am Community Member, 8 Posts

I've got a website with a few sections e.g:

Section 1
+- article 11
+- article 12
+- article 13
Section 2
+- article 21
+- article 22
+- article 23

How to configure a search engine to search only in "section 2" tree?

Thank you for your help.

Avatar
pga

12 August 2008 at 1:04am Community Member, 8 Posts

Can anybody help me how to search only in part of website?

Avatar
Blackdog

13 August 2008 at 11:02am Community Member, 156 Posts

You need to checkout getResults function in AdvancedSearchForm.php and the searchEngine function in SearchForm.php

If you were to develop your own getResults coupled with an extended searchEngine function function you could specify a variable to limit which parts of the SiteTree you search.

Avatar
Blackdog

13 August 2008 at 11:04am Community Member, 156 Posts

A nice idea, if it was a large site might be to provide a drop down with your search function which is populated by the SiteTree to allow for users to get a targeted search.

Avatar
pga

14 August 2008 at 1:25am Community Member, 8 Posts

Thank you for ideas - I'll test it.

Avatar
Rahul

16 September 2008 at 10:08pm Community Member, 8 Posts

Hi,

Please can u explain or give an example ...
How to implement this ?

Thanks
Rahul

Avatar
ojalà

10 October 2008 at 3:32am Community Member, 87 Posts

Hi!
I have your same problem..what are the part of function that I must modify?