redis migration

Signed-off-by: ale <ale@manalejandro.com>
Este commit está contenido en:
ale
2025-12-15 17:43:08 +01:00
padre da89037125
commit 4d9545d0ec
Se han modificado 18 ficheros con 1218 adiciones y 1065 borrados

34
API.md
Ver fichero

@@ -102,7 +102,7 @@ Content-Type: application/json
}
```
Note: When plaintext is provided, it is automatically indexed in Elasticsearch for future lookups.
Note: When plaintext is provided, it is automatically stored in Redis for future lookups.
#### Error Responses
@@ -113,7 +113,7 @@ Note: When plaintext is provided, it is automatically indexed in Elasticsearch f
}
```
**500 Internal Server Error** - Server or Elasticsearch error:
**500 Internal Server Error** - Server or Redis error:
```json
{
"error": "Internal server error",
@@ -127,7 +127,7 @@ Note: When plaintext is provided, it is automatically indexed in Elasticsearch f
**Endpoint**: `GET /api/health`
**Description**: Check the health of the application and Elasticsearch connection.
**Description**: Check the health of the application and Redis connection.
#### Request
@@ -139,31 +139,27 @@ No parameters required.
```json
{
"status": "ok",
"elasticsearch": {
"cluster": "elasticsearch",
"status": "green"
"redis": {
"version": "7.2.4",
"connected": true,
"memoryUsed": "1.5M"
},
"index": {
"exists": true,
"name": "hasher",
"stats": {
"documentCount": 1542,
"indexSize": 524288
}
"stats": {
"count": 1542,
"size": 524288
}
}
```
**Elasticsearch cluster status values**:
- `green`: All primary and replica shards are active
- `yellow`: All primary shards are active, but not all replicas
- `red`: Some primary shards are not active
**Redis connection status**:
- `connected: true`: Redis is connected and responding
- `connected: false`: Redis connection failed
**Error** (503 Service Unavailable):
```json
{
"status": "error",
"error": "Connection refused to Elasticsearch"
"error": "Connection refused to Redis"
}
```
@@ -252,7 +248,7 @@ The API accepts requests from any origin by default. For production deployment,
## Notes
- All timestamps are in ISO 8601 format
- The API automatically creates the Elasticsearch index if it doesn't exist
- The API automatically creates Redis keys as needed
- Plaintext searches are automatically indexed for future lookups
- Searches are case-insensitive
- Hashes must be valid hexadecimal strings