有朋友配置index_search后indexing总是没有效果,最可能原因就是页面禁止缓存了.

注意以下几点:

  • config.index_enable = 1
  • config.no_cache = 0
  • plugin.ext_demo = USER_INT的page不能indexing
  • $GLOBALS[‘TSFE’]->set_no_cache(); 的页面不能indexing

所以全局插件不要用set_no_cache(), 需要no_cache的页面可以在后台页面属性里设置。除非特殊需要没必要代码里设置,并且一个插件set_no_cache()那么页面其它内容全部会no_cache.

另外如果要指定搜索区域,需要配置mapping的TS:

10= RECORDS
10.source.current=1
10.tables = tt_content
10.wrap =  | 

否则会搜索整个<body>区域.

另外,对于搜索结果的问题,有时候页数和总数会变,是因为默认的模糊搜索模式,只需要在TS里配置

exactCount = 1 即可。(精确计数)