[opencms-dev] Restricting contents of search index (or search results)

King, Dennis DKing at netopia.com
Fri Mar 17 23:54:15 CET 2006


Hi Developers,
 
The search seems to work nicely out of the box if you want everything in
/sites/default indexed. However, I'd like exclude many files from search
results. I thought about putting a restriction on the results page of
the search and looking for a property of each page to see if a custom
value like ExcludeFromSearch was set. I expect that would be very
expensive, having to open each resource in a result set and evaluate a
property. (I also haven't figured out yet how to get from a results list
to a file object I can get the property from.)
 
I would think it would be better to have the indexing evaluate each file
and decide whether to add it to the index or not, perhaps using the same
type of property flag. Is there a way to do this? Or do I have to set up
my index source with a set of resources that are subdirectories of the
/sites/default directory, so I can create directories like
/sites/default/restricted that are not indexed because not defined as
resources, and secure content by placing it in non-indexed locations,
like:
 
<indexsource>
  <name>source1</name>
   <indexer class="org.opencms.search.CmsVfsIndexer" />
   <resources>
      <resource>/sites/default/directory1</resource>
      <resource>/sites/default/directory2</resource>
   </resources>
...
</indexsource>
 
Easy but a pain to maintain and forces non-search content to live far
from its related content siblings.
 
Thanks,
 
Dennis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060317/bf5bed31/attachment.htm>


More information about the opencms-dev mailing list