Search function with custom area names

Permalink
I named my content areas something like "Content Top", "Content Main", "Content Bottom". Search indexing does not seem to index these areas. How do I make sure that search actually indexes my areas and not just the default "Main"?

 
Tony replied on at Permalink Reply
Tony
Then add this line:
IndexedSearch::addSearchableArea('area name'))


more discussion on this here:
http://www.concrete5.org/community/forums/block_requests/bad_search...

(we should change this so it indexes all areas by default, perhaps just excluding sidebars)
guyfru replied on at Permalink Reply
I changed the code but it doesn't work. What actually happens is that the re-indexing takes forever and it never completes. Here is my code:

function run() {
      Loader::library('database_indexed_search');
      $is = new IndexedSearch();
      $is->addSearchableArea('Content Top Left'));
      $result = $is->reindex();
      return t('%s page(s) indexed.', $result->count);
   }
Tony replied on at Permalink Reply
Tony
you might have run into a timeout issue, either an apache timeout or a php timeout.
frz replied on at Permalink Reply
frz
just guessing - but do your area handles actually have spaces in them?
guyfru replied on at Permalink Reply
Yes my area names have spaces. One area is named as "Content Top Left".

Does "addSearchableArea" function not take spaces in the area names? I can change them if thats the case but if I do it does my content disappear from the live pages?