mirror of
https://github.com/hcengineering/platform.git
synced 2026-08-17 18:05:42 +02:00
3.5 KiB
3.5 KiB
Fulltext Service
Fulltext indexing service for the Platform. Provides full-text search capabilities by indexing documents and communication messages.
Environment Variables
Required
SERVER_SECRET- Secret key for server authenticationDB_URL- Database connection URL (PostgreSQL or MongoDB)FULLTEXT_DB_URL- Elasticsearch connection URL (e.g.,http://localhost:9200)REKONI_URL- Rekoni service URL for content extraction (e.g.,http://localhost:4004)ELASTIC_INDEX_NAME- Name of the Elasticsearch index to useACCOUNTS_URL- Accounts service URL (e.g.,http://localhost:3000)
Optional
PORT- Service port (default:4700)MODEL_JSON- Path to model JSON file (default:model.json)HULYLAKE_URL- Hulylake service URL for communication indexing (default: empty string)- Required only if
COMMUNICATION_API_ENABLED=true
- Required only if
COMMUNICATION_API_ENABLED- Enable communication API for indexing messages (default: disabled)- Set to
'true'to enable indexing of communication messages from cards - When disabled, communication indexing is skipped even if
HULYLAKE_URLis provided
- Set to
ENABLE_CONSOLE- Enable console logging (default:'true')VERSION- Service version (default:'0.7.0')DB_PREPARE- Enable database prepared statements (default:'true')STORAGE_CONFIG- Storage configuration (see storage service documentation)
Features
- Full-text indexing of documents and attachments
- Communication message indexing (when
COMMUNICATION_API_ENABLED=true) - Elasticsearch integration for search
- Rekoni integration for content extraction from various file types
- Workspace-based indexing with automatic reindexing support
API Endpoints
PUT /api/v1/search- Search documentsPUT /api/v1/full-text-search- Full-text searchPUT /api/v1/index-documents- Index specific documentsPUT /api/v1/reindex- Reindex workspacePUT /api/v1/close- Close workspace indexer
Reindexing a Workspace
Using the Dev Tool (Recommended)
The easiest way to reindex a workspace is using the dev tool:
# Set FULLTEXT_URL environment variable
export FULLTEXT_URL=http://localhost:4700
# Reindex a specific workspace
rushx tool fulltext-reindex <workspace-name>
This sends a reindex event through the queue system, which is the recommended approach.
Using the API Directly
You can also call the reindex endpoint directly via HTTP:
Endpoint: PUT http://<fulltext-service-url>/api/v1/reindex
Request Body:
{
"token": "<workspace-token>",
"onlyDrop": false
}
Or use Authorization header:
curl -X PUT http://localhost:4700/api/v1/reindex \
-H "Authorization: Bearer <workspace-token>" \
-H "Content-Type: application/json" \
-d '{"onlyDrop": false}'
Parameters:
token(required): A valid token containing workspace information. Can be provided in the request body or asAuthorization: Bearer <token>header.onlyDrop(optional): Iftrue, only clears the index without reindexing. Default:false.
Note: The token must be generated with the workspace UUID and signed with the same SERVER_SECRET used by the fulltext service.
Communication API
When COMMUNICATION_API_ENABLED=true, the service will:
- Index communication messages from cards
- Use Hulylake service to fetch message groups and messages
- Require
HULYLAKE_URLto be set
When disabled (default), communication indexing is skipped, preventing errors if Hulylake is not available.