Pricing Database
Manage product pricing data with smart search, natural-language price detection, and dynamic schema support.
editor manager superadmin
Overview
The Pricing Database stores structured product pricing information. It supports full-text search via FTS5, semantic search via VectorDB, and smart price-range detection that understands natural language queries like "harga antara 200 juta sampai 300 juta".
Default Fields
| Field | Type | Required | FTS Weight | Description |
|---|---|---|---|---|
product_name | Text | Required | 2.0 (highest) | Product display name — primary search field |
sku | Text | Optional | 1.0 | Stock keeping unit / product code |
price | Real | Required | — | Numeric price value (not FTS-indexed) |
currency | Text | Optional | 0.5 | Currency code (default: IDR) |
unit | Text | Optional | 0.5 | Pricing unit (default: unit) |
category | Text | Optional | 1.5 | Product category for grouping and filtering |
description | Text | Optional | 1.0 | Product description |
superadmin users can add custom fields via the Schema Editor. Each field's FTS weight and VectorDB template are configurable.
Browse & Search
Table View
The pricing page shows all records in a paginated, searchable table.
Search Behavior
The search box uses FTS5 full-text search. It searches across these fields (with different weights):
weight 2.0"] FTS --> F2["category
weight 1.5"] FTS --> F3["sku
weight 1.0"] FTS --> F4["description
weight 1.0"] style Q fill:#3B82F6,color:#fff style F1 fill:#22C55E,color:#fff style F2 fill:#84CC16,color:#fff
Fields with higher FTS weights rank higher in search results. For example, searching "Honda Veloz"
will prioritize records where "Honda Veloz" appears in product_name (weight 2.0)
over those where it only appears in description (weight 1.0).
Filters & Controls
- Search — Full-text search across all FTS-indexed fields
- Category filter — Dropdown populated from distinct categories in the database
- Page size — 25, 50, 100, or 150 records per page
Smart Price-Range Detection
When users search via the query API (or the widget), BABEH automatically detects price-related natural language and converts it into numeric filters. This works in Indonesian and English.
| Pattern | Example | Interpretation |
|---|---|---|
| Explicit range | "antara 200 juta sampai 300 juta" | 200,000,000 ≤ price ≤ 300,000,000 |
| Upper bound | "budget 500 juta" / "dibawah 1 miliar" | price ≤ 500,000,000 |
| Lower bound | "diatas 200 juta" | price ≥ 200,000,000 |
| Approximate | "sekitar 300 juta" | 240,000,000 ≤ price ≤ 360,000,000 (±20%) |
Indonesian currency units are automatically converted:
miliar = 1,000,000,000 |
juta = 1,000,000 |
ribu = 1,000
Add / Edit / Delete Records
Adding a Record
- Click the "+ Add" button above the table.
- A modal appears with a dynamic form generated from the current schema.
- Fill in the required fields (marked with a red asterisk).
- Click Save. The record is validated against the schema before saving.
Editing a Record
Click the Edit button on any row to open the edit modal. The form is pre-populated with current values. Modify fields and click Save.
Deleting a Record
Click the Delete button on a row. A confirmation dialog appears. Once confirmed, the record is permanently deleted.
Import & Export
Import CSV
- Click "Import" → select CSV tab.
- Choose a CSV file. Column headers must match the schema field names (e.g.,
product_name,price,category). - The system maps columns by name and validates each row against the schema.
- A summary shows how many records were imported successfully.
Import JSON
Accepts two formats:
- Array format:
[{"product_name": "...", "price": 100}, ...] - Envelope format:
{"items": [...]}
Export
- Export JSON — Downloads a JSON file with a schema version metadata envelope
- Export CSV — Downloads a CSV file with metadata comments at the top
VectorDB Sync
Pricing records can be indexed in ChromaDB for semantic search, allowing the AI to find relevant pricing when users ask natural-language questions.
- Click the "Sync VectorDB" button at the top of the pricing page.
- All records are processed: a text representation is generated from the VectorDB template in the schema, then embedded.
- The
vectordb_syncedflag is set to1for each synced record.
You should sync VectorDB after:
- Importing new records
- Making bulk edits
- Changing the VectorDB template in the Schema Editor
Truncate (Empty Database)
The "Truncate" button deletes ALL pricing records permanently. This action cannot be undone. Export your data first if you need a backup.
Only use this when you want to start fresh — for example, before a complete data reimport.