52North / innovation-prize

1 stars 0 forks source link

ED: Remove Datasets from search #17

Open SpeckiJ opened 8 months ago

SpeckiJ commented 8 months ago

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

ridoo commented 8 months ago

Opt-Out

ridoo commented 1 month ago
ridoo commented 6 days ago

Two step approach

simeonwetzel commented 6 days ago

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
simeonwetzel commented 6 days ago

Todo: Authentification mechanism for upsert/delete in index