1

I have implemented my search features on OpenCMS. Indexed resource comes from many path (e.g. /path/alternative/news and /path/news). There's a way to perform separated search for every resource or I need two separated index?

BAD_SEED
  • 4,840
  • 11
  • 53
  • 110
  • 1
    When you go to the OpenCms workplace / Administration / Search Management, and run a query in there on any of the indexes, you can see that you can optionally select a 'Search folder'. So I assume this option/parameter should also be available for your own search (by adding this parameter in the search form in the jsp template). I don't know the exact parameter name yet, but once I know, I will make an answer out of this comment :) – Mathias Conradt Aug 08 '12 at 15:27
  • 1
    I resolved by adding: setSearchRoot("/path/news"); and setSearchRoot("/path/alternative/news"); to the search bean. – BAD_SEED Aug 09 '12 at 08:48
  • Happy to hear. You should make it an answer of the question and close it. I think it's helpful, quite common question I think. – Mathias Conradt Aug 10 '12 at 04:16

1 Answers1

1

Once indexed the single resources, we can use setSearchRoot() method of the search bean. If I want to perform search inside /path/alternative/news, i set setSearchRoot("/path/alternative/news") otherwise, setSearchRoot("/path/news").

Hope that helps.

BAD_SEED
  • 4,840
  • 11
  • 53
  • 110