-
Notifications
You must be signed in to change notification settings - Fork 0
Method facet_menu
Maruf Çetin edited this page Sep 1, 2026
·
2 revisions
Turkce Dokumantasyon | English Documentation
Category: Query & Search Methods
Submodule:AmberDB::Index::Facet
Entry Type: Faceted Navigation Menu Generator
facet_menu() generates dynamic, multi-dimensional faceted navigation menus for catalog and search interfaces. It computes accurate disjunctive (OR) and conjunctive (AND) hit counts across millions of records using columnar bitset files (.fac) and bidirectional string dictionaries (.unq).
my $menu = $adb->facet_menu($table_id, \%selected_filters, [\@facet_defs], [\%options]);| Parameter / Option | Type | Required | Description |
|---|---|---|---|
$table_id |
String | Required | Table name (e.g. "catalog_product"). |
\%selected_filters |
Hash-ref | Required | Currently selected filters: { block_idx => value_or_arrayref }. |
\@facet_defs |
Array-ref | Optional | Custom facet definitions (reads from schema if omitted). |
base_ids |
Array-ref | Optional | Scope calculation to a specific record ID subset (e.g. search result IDs). |
sort |
String | Optional |
'count' (default, descending hit count) or 'label' / 'name'. |
top |
Integer | Optional | Maximum options returned per facet group. |
min_count |
Integer | Optional | Minimum hit count required to include an option (default: 1). |
my $menu_data = $adb->facet_menu(
"catalog_product",
{
1 => "5", # Category = 5
2 => [ "12", "14" ], # Brand = 12 OR 14
},
undef,
{ sort => 'count', top => 10 }
);
print "Matching Products: $menu_data->{count}\n";
# $menu_data->{ids} contains filtered record IDsAmberDB — 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