def search_adapter_helper(adapter):
    settings = {'srcdir': ((rootdir / 'roots') / 'test-searchadapters'), 'builddir': (tempdir / 'websupport'), 'status': StringIO(), 'warning': StringIO(), 'search': adapter}
    support = WebSupport(**settings)
    support.build()
    s = support.search
    results = s.query(u'Epigraph')
    assert (len(results) == 1), ('%s search adapter returned %s search result(s), should have been 1' % (adapter, len(results)))
    s.init_indexing(changed=['markup'])
    s.add_document(u'markup', u'filename', u'title', u'SomeLongRandomWord')
    s.finish_indexing()
    results = s.query(u'Epigraph')
    assert (len(results) == 0), ('%s search adapter returned %s search result(s), should have been 0' % (adapter, len(results)))
    results = s.query(u'SomeLongRandomWord')
    assert (len(results) == 1), ('%s search adapter returned %s search result(s), should have been 1' % (adapter, len(results)))
    support.get_search_results(u'SomeLongRandomWord')
def search_adapter_helper(adapter):
    settings = {'srcdir': ((rootdir / 'roots') / 'test-searchadapters'), 'builddir': (tempdir / 'websupport'), 'status': StringIO(), 'warning': StringIO(), 'search': adapter}
    support = WebSupport(**settings)
    support.build()
    s = support.search
    results = s.query(u'Epigraph')
    assert (len(results) == 1), ('%s search adapter returned %s search result(s), should have been 1' % (adapter, len(results)))
    s.init_indexing(changed=['markup'])
    s.add_document(u'markup', u'filename', u'title', u'SomeLongRandomWord')
    s.finish_indexing()
    results = s.query(u'Epigraph')
    assert (len(results) == 0), ('%s search adapter returned %s search result(s), should have been 0' % (adapter, len(results)))
    results = s.query(u'SomeLongRandomWord')
    assert (len(results) == 1), ('%s search adapter returned %s search result(s), should have been 1' % (adapter, len(results)))
    support.get_search_results(u'SomeLongRandomWord')