예제 #1
0
def detect(doc):
    try:
        results = search.search('scrapi', doc.get('id').get('service_id'))
    except ElasticHttpNotFoundError:
        return False

    if len(results) != 0:
        return True
    else:
        return False
예제 #2
0
def detect(doc):
    try:
        results = search.search('scrapi', doc.get('id').get('service_id'))
    except ElasticHttpNotFoundError:
        return False

    if len(results) != 0:
        return True
    else:
        return False
예제 #3
0
 def test_delete_doc(self):
     search.delete_doc('test', 'article', '38')
     results, count = search.search('test', 'test')
     assert len(results) == count
     assert len(results) == 0
예제 #4
0
 def test_search(self):
     results, count = search.search('test', 'test')
     assert len(results) == count
     assert len(results) == 1
예제 #5
0
 def test_delete_doc(self):
     search.delete_doc('test', 'article', '38')
     results, count = search.search('test', 'test')
     assert len(results) == count
     assert len(results) == 0
예제 #6
0
 def test_search(self):
     results, count = search.search('test', 'test')
     assert len(results) == count
     assert len(results) == 1