Skip to content

Method field_filter

marufcetin edited this page Sep 1, 2026 · 1 revision

Method: field_filter()

Turkce Dokumantasyon | English Documentation

Category: Query & Search Methods
Submodule: AmberDB
Entry Type: Compound Multi-Block Filter


1. Definition and Overview

field_filter() executes multi-block compound queries (AND / OR) across inverted field indexes with support for multi-value filters, tier mode selection (jnktype), sorting, and pagination.


2. Syntax and Signature

my $result = $adb->field_filter($table_id, \%filter_options);

3. Filter Options Structure

{
    type    => "and" | "or",                 # Compound matching logic
    filter  => { 1 => "5", 6 => ["12", "14"] }, # { block_index => value_or_arrayref }
    sort    => { blk => 3, reverse => 1 },   # Sorting options
    jnktype => "AB",                         # Tier mode
    start   => 0,                            # Pagination start offset
    limit   => 20,                           # Pagination limit
}

4. Return Value

Returns a hash reference:

{
    count => $total_matching_count,
    ids   => \@matching_record_ids,
}

5. Practical Code Example

my $res = $adb->field_filter("catalog_product", {
    type    => "and",
    filter  => { 1 => "5", 2 => [ "10", "12" ] },
    sort    => { blk => 3, reverse => 0 },
    start   => 0,
    limit   => 20,
});

print "Found $res->{count} products.\n";
my @page_products = $adb->read_list("catalog_product", $res->{ids});

6. See Also

AmberDB Encyclopedia

Home · A-Z Index


Getting Started & Guides


Core Concepts


Core CRUD Methods


Query, Search & Facets


Transactions & Locks


Cache, Buffer & Low-Level


Locale & Helpers


Maintenance & Tools


Configuration Flags


File Formats


Language

Clone this wiki locally