[opencms-dev] Why does this search script only work in site = "/"

Joe Desbonnet jdesbonnet at gmail.com
Thu Dec 15 03:05:11 CET 2005

I've been following some of the recent discussion on search indexes on
the list. But I still can not get OpenCms search to work properly in
my case.

Here is a short JSP script which should print out the number of
keyword hits in my index. It only returns results if run  the explorer
while Site = "/".  I get zero hits if I set Site to my website.

This must be some sort of permissions problem -- ie my site is not
priviliged to access it's own index (??).


<%@ page buffer="none" import="org.opencms.main.*,
org.opencms.search.*, org.opencms.file.*, org.opencms.jsp.*,
java.util.*" %><%

CmsJspActionElement cms = new CmsJspActionElement(pageContext,
request, response);

CmsSearch search = new CmsSearch();
search.init (cms.getCmsObject());

String[] fields = {"contents","title"};

List result=search.getSearchResult();
if (result == null) {
	out.write ("got null result list");
out.write ("got " + result.size() + " results");

Here is my indexes element in opencms-search.xml:


Here is my sources element in opencms-search.xml:

class="org.opencms.search.CmsVfsIndexer" />

More information about the opencms-dev mailing list