Open SpeckiJ opened 8 months ago
Opt-Out
Two step approach
Hier sind diese endpoints implementiert: https://github.com/52North/innovation-prize/blob/dev/search-app/server/app/server.py
# Clear complete index
@app.get("/clear_index")
async def clear_index(index_name: str):
if index_name not in (indexes, 'geojson'):
raise HTTPException(status_code=400, detail="Invalid index name")
elif index_name == 'geojson':
local_file_indexer._clear()
else:
indexes[index_name]._clear()
return {'message': 'Index cleared'}
# Get specific document from index
@app.get("/retrieve_with_id")
async def retrieve_with_id(index_name: str, _id: str):
if index_name not in indexes:
raise HTTPException(status_code=400, detail="Invalid index name")
retrieved_id = indexes[index_name]._get_doc_by_id(_id)
return {'id': retrieved_id}
# Delete specifc document from index
@app.get("/remove_doc_from_index")
async def remove_doc_from_index(index_name: str, _id: str):
if index_name not in indexes:
raise HTTPException(status_code=400, detail="Invalid index name")
result = indexes[index_name]._delete_doc_from_index(_id)
return result
Todo: Authentification mechanism for upsert/delete in index
I want to remove my dataset from the full text search (after i initially added it) because the paper this dataset is based on was retracted