コード例 #1
0
def depatech_crawl(constituents, query, chunksize, options=None):
    client = get_depatech_client()
    try:
        return client.crawl(constituents, query, chunksize)
    except SyntaxError as ex:
        log.warn('Invalid query for depa.tech: %s' % ex.msg)
        raise
コード例 #2
0
def status_upstream_depatech_handler(request):
    client = get_depatech_client()
    query = SmartBunch({
        'expression': '(PC:DE AND DE:212016000074 AND KI:U1) OR AN:DE212016000074U1 OR NP:DE212016000074U1',
    })
    data = client.search_real(query)
    assert data, 'Empty response from MTC depa.tech'
    return "OK"
コード例 #3
0
def depatech_search(query, options=None):

    options = options or SmartBunch()

    client = get_depatech_client()
    try:
        data = client.search(query, options)
        # Raise an exception on empty results to skip caching this response
        if data.meta.navigator.count_total == 0:
            raise NoResultsException('No results', data=data)
        return data

    except SearchException as ex:
        client.stale = True
        raise