Skip to main content

Meilisearch Index JSON (HIPAA + FINRA Filter Fields)

Index settings for a documents index optimized for compliance filtering and search.

Index Settings

{
"uid": "documents",
"primaryKey": "doc_id",

"searchableAttributes": [
"title",
"headings",
"body"
],

"filterableAttributes": [
"domain",
"document_type",
"jurisdiction",
"regulations",
"security_class",
"contains_phi",
"contains_pii",
"contains_financial",
"status",
"retention_category",
"business_unit",
"desk",
"facility",
"owner_role",
"owner_user_id",
"effective_date",
"review_due_date",
"retain_until",
"created_at",
"last_modified_at"
],

"sortableAttributes": [
"effective_date",
"review_due_date",
"retain_until",
"created_at",
"last_modified_at"
],

"rankingRules": [
"words",
"typo",
"proximity",
"attribute",
"sort",
"exactness"
],

"stopWords": [
"the", "a", "an", "and", "or", "but",
"in", "on", "at", "to", "for"
],

"synonyms": {
"phi": ["protected health information", "health data"],
"pii": ["personally identifiable information", "personal data"],
"hipaa": ["health insurance portability"],
"finra": ["financial industry regulatory"],
"sec": ["securities and exchange commission"]
}
}

Document Structure

Each indexed document should look like:

{
"doc_id": "550e8400-e29b-41d4-a716-446655440000",
"title": "HIPAA Privacy Officer Policy",
"headings": ["Purpose", "Scope", "Responsibilities", "Procedures"],
"body": "This policy defines the role and responsibilities of the Privacy Officer...",

"domain": "security-privacy",
"document_type": "policy",
"jurisdiction": ["US"],
"regulations": ["HIPAA-164.316", "HIPAA-164.530"],
"security_class": "confidential",
"contains_phi": true,
"contains_pii": true,
"contains_financial": false,
"status": "effective",
"retention_category": "HIPAA-6Y",

"business_unit": "Compliance",
"desk": null,
"facility": "Hospital-A",
"owner_role": "Privacy Officer",
"owner_user_id": "u123",

"effective_date": "2025-01-01",
"review_due_date": "2027-01-01",
"retain_until": "2031-01-01",
"created_at": "2025-01-01T10:00:00Z",
"last_modified_at": "2025-01-10T11:00:00Z"
}

API Setup Commands

Create Index

curl -X POST 'http://localhost:7700/indexes' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
--data-binary '{
"uid": "documents",
"primaryKey": "doc_id"
}'

Update Settings

curl -X PATCH 'http://localhost:7700/indexes/documents/settings' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
--data-binary '{
"searchableAttributes": ["title", "headings", "body"],
"filterableAttributes": [
"domain", "document_type", "jurisdiction", "regulations",
"security_class", "contains_phi", "contains_pii", "contains_financial",
"status", "retention_category", "business_unit", "desk", "facility",
"owner_role", "owner_user_id", "effective_date", "review_due_date",
"retain_until", "created_at", "last_modified_at"
],
"sortableAttributes": [
"effective_date", "review_due_date", "retain_until",
"created_at", "last_modified_at"
]
}'

Example Queries

curl -X POST 'http://localhost:7700/indexes/documents/search' \
-H 'Content-Type: application/json' \
--data-binary '{
"q": "privacy policy",
"limit": 20
}'

Compliance Filter

curl -X POST 'http://localhost:7700/indexes/documents/search' \
-H 'Content-Type: application/json' \
--data-binary '{
"q": "breach notification",
"filter": "regulations = \"HIPAA-164.316\" AND status = \"effective\"",
"limit": 20
}'

PHI Documents Only

curl -X POST 'http://localhost:7700/indexes/documents/search' \
-H 'Content-Type: application/json' \
--data-binary '{
"q": "*",
"filter": "contains_phi = true AND facility = \"Hospital-A\"",
"sort": ["last_modified_at:desc"],
"limit": 50
}'

FINRA Documents

curl -X POST 'http://localhost:7700/indexes/documents/search' \
-H 'Content-Type: application/json' \
--data-binary '{
"q": "trading procedure",
"filter": "regulations = \"FINRA-4511\" AND domain = \"finance\"",
"limit": 20
}'

Documents Approaching Review

curl -X POST 'http://localhost:7700/indexes/documents/search' \
-H 'Content-Type: application/json' \
--data-binary '{
"q": "*",
"filter": "review_due_date < 1735689600 AND status = \"effective\"",
"sort": ["review_due_date:asc"],
"limit": 50
}'

Notes

  • searchableAttributes limit text search to content fields
  • filterableAttributes enable compliance and access filtering
  • Frontend can combine text search with ABAC filters (e.g., facility = "Hospital-A")
  • Date fields stored as Unix timestamps for range queries

References