-
Notifications
You must be signed in to change notification settings - Fork 0
Concept Disjunctive Faceting
Turkce Dokumantasyon | English Documentation
Category: Core Concepts & Architecture
Subsystem: Faceted Navigation Engine (AmberDB::Index::Facet)
Entry Type: Architectural Concept
Columnar Disjunctive Facet Filtering is AmberDB's engine for generating real-time multi-dimensional faceted navigation menus for e-commerce catalogs and complex filtering interfaces.
In modern e-commerce filtering, selections within the same attribute group (e.g. Color = Red OR Blue) use Disjunctive (OR) logic, while combinations across different attribute groups (e.g. Brand = Apple AND Color = Red) use Conjunctive (AND) logic. Crucially, the UI must display the accurate remaining match counts for unselected options within an active filter group.
AmberDB achieves this at scale by storing facet data in partitioned columnar forward bitset files (_${blk}.fac) and bidirectional string dictionaries (_${blk}.unq), computing disjunctive facet counts across millions of records in single-digit milliseconds without full-table scanning.
Disjunctive Faceting Logic Pipeline
Active Selection: { Category => 5, Brand => ["Apple", "Sony" ], Color => "Black" }
Category Filter: [Category = 5 ] (AND)
Brand Filter: [Brand = Apple OR Brand = Sony ] (OR - Disjunctive Multi-Select)
Color Filter: [Color = Black ] (AND)
Bitset Intersections via Columnar .fac
Generates Filtered Record IDs + Recalculated Facet Group Counts:
- Brands: Apple (42), Sony (18), Bose (12), Sennheiser (7)
- Colors: Black (60), Silver (24), White (15)
- Price Ranges: $0-$100 (15), $100-$300 (45), $300+ (20)
-
Partitioned Columnar Bitsets (
_${blk}.fac): Each facet-enabled block has an independent forward file mapping Record ID to compact value IDs. Only active, in-stock records are stored. -
Bidirectional String Dictionaries (
_${blk}.unq): Transparently converts arbitrary text labels (e.g. "Space Gray", "16GB RAM") to compact integer dictionary IDs. -
Dynamic Scoping (
base_ids): Facet calculations can be restricted dynamically to search result ID arrays (search_table) or arbitrary base record filters.
# Generate faceted navigation menu
my $menu = $adb->facet_menu(
"catalog_product",
{
1 => "5", # Category = 5
2 => ["12", "14" ], # Brand = 12 OR 14 (Disjunctive OR selection)
},
undef, # Automatically uses schema facet_block configuration
{
sort => "count", # Sort options by matched item count descending
top => 10, # Retain top 10 options per group
min_count => 1, # Omit zero-count entries
}
);
# $menu structure:
# {
# count => 56, # Total matched products
# ids => [101, 104, ...], # Matched product IDs
# groups => [... ], # Hierarchical menu tree
# active_counts => { ... } # Raw facet counts
# }AmberDB — High-Performance Schema-Driven NoSQL Database Engine for Perl.
Copyright 2005-2026 Maruf Cetin. Released under the Artistic License 2.0.
CPAN · GitHub Repository · Issue Tracker
- Berkeley DB (DB_File) Engine
- AmberDB Table Schema
- Global Flags
- Table Schema Flags
- Directory Structure
- File Structure (Extensions)
- Repeat Blocks
- Auto-Increment ID
- ASCII ID
- Relational Records
- Record Anatomy
- JOIN-Free Architecture
- Packed Binary Index
- Strict 2PL Locking
- Undo Journal & Rollback
- Tiered Junk Indexing
- Disjunctive Faceting
- Phonetic Accent Search
- 2-Pillar Disaster Recovery
- RAM-Disk Acceleration
- In-Memory Schema Mutation
- Simple Mode
- new
- config
- set_datadir
- insert_id
- insert_list
- modify_id
- modify_list
- delete_id
- delete_list
- read_id
- read_all
- read_list
- exist_id
- exist_list
- exist_table
- table_count
- table_keys
- table_lastid
- table_attr
- table_create
- field_fetch
- field_filter
- search_table
- facet_menu
- field_fltkeys
- field_allfltkeys
- facet_rules
- slug_read
- slug_fetch
- transact_start
- transact_end
- transact_commit
- transact_rollback
- transact_recover
- flock_open
- flock_close
- cache_setup
- cache_read
- cache_write
- cache_delete
- cache_preload
- cache_ensure
- buffer_write
- buffer_read
- buffer_delete
- recs_scan
- recs_get
- recs_put
- recs_del
- locale_uc
- locale_lc
- locale_sort
- locale_to_ascii
- locale_num2text
- locale_format_currency
- locale_format_date
- array_sort
- array_punch
- array_filter
- array_sublist
- deep_copy
- log_owner
- use_counter
- use_junk
- keep_deleted
- auto_id
- buffer_write
- simple
- no_write
- no_backup
- jnktype
- keys_only
- id_type
- language
- .db · .table · .dbase
- .inx · .fld · .src
- .fac · .srt · .slg
- .unq · .del · .aut
- .cnt · .txn · .amberdb
- .csv · .cache · .tmp