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

David db92rj45 at gmail.com
Wed Jul 13 10:27:51 CEST 2005


Hi Andras,
 Thanks very much for your prompt response.
 I already customised my search engine (in the opencms-search.xml) to point 
to only a specific search path in my application (e.g. /sites/myapp/) so 
that there is only one indexsource running. Here is the customisation 
snippet:
 <indexsource>
<name>myapp</name>
<indexer class="org.opencms.search.CmsVfsIndexer" />
<resources>
<resource>/sites/myapp/content/</resource>
</resources>

<documenttypes-indexed>
<name>xmlpage</name>
<name>xmlcontent</name>
<name>page</name>
<name>text</name>
<name>pdf</name>
<name>rtf</name>
<name>html</name>
<name>msword</name>
<name>msexcel</name>
<name>mspowerpoint</name>
<name>image</name>
<name>generic</name>
</documenttypes-indexed>
</indexsource>
 Here I am only indexing on files stored in /sites/myapp/content folder of 
myapp application. The indexing works fine and I can do searches on this 
entire index source. What I am trying to achieve next is to further limit 
the scope of my search to only a selected list of files (given the file 
names) in this folder. Would the method setSearchRoots() solve this? Does 
the parameter searchRoots of this method mean an array of file names?
 Can you elaborate a bit more from your suggestion? Thanks.
 Rgds,
David.
 On 7/13/05, Andras Balogh <abalogh at gmail.com> wrote: 

> Hello David,
> 
> You can customize the search in the file
> WEB-INF/config/opencms-search.xml.
> You can configure here multiple indexes and multiple sources.
> After that check the class org.opencms.search.CmsSearch methods:
> 
> setIndex(String indexName)
> setSearchRoots(String[] searchRoots)
> 
> Best regards,
> Andras
> 
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20050713/8788c6c8/attachment.htm>


More information about the opencms-dev mailing list