发布于 2015-09-16 15:35:21 | 114 次阅读 | 评论: 0 | 来源: 网络整理

To create a custom search adapter you will need to subclass the BaseSearch class. Then create an instance of the new class and pass that as the search keyword argument when you create the WebSupport object:

support = WebSupport(srcdir=srcdir,
                     builddir=builddir,
                     search=MySearch())

For more information about creating a custom search adapter, please see the documentation of the BaseSearch class below.

  • class sphinx.websupport.search.BaseSearch
  • Defines an interface for search adapters.

BaseSearch Methods

The following methods are defined in the BaseSearch class. Some methods do not need to be overridden, but some (add_document() and handle_query()) must be overridden in your subclass. For a working example, look at the built-in adapter for whoosh.
最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务