[opencms-dev] How to limit search to a document set

Andras Balogh abalogh at gmail.com
Wed Jul 13 10:21:37 CEST 2005


Hello,

philip lau wrote:

>Hi Andras,
>
>I was also having some problem configuring a path for the search
>engine. Can you please explain what you mean by checking the class
>org.opencms.search.CmsSearch methods:
>
>setIndex(String indexName)
>setSearchRoots(String[] searchRoots)
>
>Do you mean I have to recompile this class with above changes to these methods.
>  
>

No no need to change(or recompile) that class only use the methods 
mentioned above like this:
example:
cmssearch.setIndex("Online_en");
cmssearch.setSearchRoots(new String[]{"/products","/product_downloads"});

Here "Online_en" is the name of the index configured in 
opencms-search.xml and the setSearchRoots sets the folders in which
the search will be performed.

>Many thanks,
>
>Philip Lau
>
>  
>
Best regards,
Andras.



More information about the opencms-dev mailing list