Exemple #1
0
 def test_delete_source(self):
     collection = Collection.by_id(1000)
     res = self.client.get('/api/2/search?q="mention fruit"')
     assert res.json['total'] == 1, res.json
     delete_collection(collection.id)
     flush_index()
     res = self.client.get('/api/2/search?q="mention fruit"')
     assert res.json['total'] == 0, res.json
Exemple #2
0
 def test_delete_source(self):
     collection = Collection.by_id(1000)
     res = self.client.get('/api/1/query?q="mention fruit"')
     assert res.json['total'] == 1, res.json
     delete_collection(collection.id)
     optimize_search()
     res = self.client.get('/api/1/query?q="mention fruit"')
     assert res.json['total'] == 0, res.json
Exemple #3
0
 def test_delete_source(self):
     collection = Collection.by_id(1000)
     res = self.client.get('/api/1/query?q="mention fruit"')
     assert res.json['total'] == 1, res.json
     delete_collection(collection.id)
     optimize_search()
     res = self.client.get('/api/1/query?q="mention fruit"')
     assert res.json['total'] == 0, res.json
Exemple #4
0
def flush(foreign_id):
    """Reset the crawler state for a given collecton."""
    collection = Collection.by_foreign_id(foreign_id)
    if collection is None:
        raise ValueError("No such collection: %r" % foreign_id)
    delete_collection(collection.id)
Exemple #5
0
def flush(foreign_id):
    """Reset the crawler state for a given collecton."""
    collection = Collection.by_foreign_id(foreign_id)
    if collection is None:
        raise ValueError("No such collection: %r" % foreign_id)
    delete_collection(collection.id)