QualityDocD provides two search interfaces backed by two search engines. The .NET application’s Reports/Search page and the PHP portal’s Documents page both query the Search Service first, falling back to SQL Server (or PostgreSQL token index) when the service is unavailable. The Node.js API exposes a lower-level search endpoint with granular control over search mode and field targeting. This guide explains how each interface works and when to use each one.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/juescoryisus/QualityDocD/llms.txt
Use this file to discover all available pages before exploring further.
Search interfaces
- .NET App — Reports/Search
- Node.js API — GET /search
- PHP Portal — documents.php
The .NET application exposes a search report at
Results are returned as cards showing the document code, status badge, title, category, standard, and up to five tags. Each card links to the document detail page in the .NET app.Fallback behavior: When the Search Service HTTP call fails or returns a non-success status code, the .NET app automatically falls back to a SQL Server query. The fallback returns up to 50 results ordered by creation date descending.Example curl:
GET /Reports/Search. This interface accepts the parameters q, category, and status, and internally calls the Search Service. If the Search Service is unavailable, it falls back to a SQL Server query against titles, descriptions, codes, and tags.Endpoint:| Parameter | Description |
|---|---|
q | Free-text search term matched against title, description, code, and tags. |
category | Filter by document category (e.g., Manual, Procedure, Record, Audit). |
status | Filter by document status (e.g., Approved, Draft). |
Access to
/Reports/Search requires the Admin, Manager, or Reviewer role. Unauthenticated or Viewer-only users are redirected to login.Search modes
The Node.js APIGET /search supports three modes that control which engines are queried:
| Mode | Primary engine | Fallback | matchedIn value |
|---|---|---|---|
metadata | MongoDB $text index on title, description, tags, standard | PostgreSQL token index | metadata or title/body/both |
content | MongoDB regex search on contentText | None | content |
all | Both metadata and content | PostgreSQL token index for metadata half | metadata, content, or metadata+content |
MongoDB metadata search
Whenmode=metadata (or mode=all) and a non-empty q is provided, the search queries the MongoDB document_metadata collection using a $text index with the following field weights:
| Field | Weight |
|---|---|
title | 10 |
tags | 5 |
standard | 3 |
description | 1 |
PostgreSQL token fallback
If the MongoDB query fails (e.g., MongoDB is offline), the metadata search falls back to the PostgreSQLsearch_index table. The fallback tokenizes the query and matches against pre-built titleTokens and bodyTokens arrays stored per document version. The field parameter controls whether only title tokens, only body tokens, or both are checked.
Content search
Whenmode=content (or mode=all) and q is non-empty, a MongoDB regex search ($regex, case-insensitive) is performed against the contentText field. If a document was already found in the metadata pass, its matchedIn field is updated to metadata+content rather than adding a duplicate result.
Autocomplete suggestions
q.
Access requirement: MODULE_3 (OPERATOR role or higher).
Response:
Manually re-indexing a document version
Manual re-indexing via
POST /search/index requires MODULE_1 access (OPERATOR role or higher). Documents are automatically indexed when a version is approved via POST /documents/:id/versions/:versionId/approve — manual re-indexing is only needed for exceptional cases.Automatic indexing
Documents are automatically synced to the Search Service whenever they are created, updated, submitted for review, approved, rejected, or marked obsolete in the .NET application. The sync call posts document metadata (id, code, title, description, category, standard, tags, fileExtension, status, isPublic) toPOST /api/documents on the Search Service, which upserts the record in the MongoDB document_metadata collection.
If the Search Service is unavailable during a sync, the error is logged as a warning and the primary operation (create/update/approve) continues without being blocked.