# Search & Filtering

Finding the right products quickly is essential for efficient point-of-sale operations. WCPOS provides powerful search and filtering capabilities to help you locate products instantly, even with large inventories.

![Product search and filtering interface](/img/product-search-and-filtering.png)

Product search and filtering interface in WCPOS

## Product Search[​](#product-search "Direct link to Product Search")

### Unified Search Field[​](#unified-search-field "Direct link to Unified Search Field")

WCPOS features a single search field that simultaneously searches across multiple product attributes:

* **Product Name** - Searches the product title and description
* **SKU** - Matches product postmeta `_sku` field
* **Barcode** - Searches configured barcode field, which can be any postmeta field. The legacy setting is `_sku`, but this will be changed to `_global_unique_id` in the future.

Simply type your search term into the "Search Products" field, and the POS will instantly filter results across all these fields.

### Tokenized Search Technology[​](#tokenized-search-technology "Direct link to Tokenized Search Technology")

The search functionality uses the [FlexSearch library](https://github.com/nextapps-de/flexsearch) with advanced tokenization capabilities:

* **Forward Tokenization** - Matches partial words from the beginning (e.g., searching "blue" will find "blueberry")
* **Performance Optimized** - Uses a performance preset for fast search results
* **Language Aware** - Adapts to your store's configured language
* **Lazy Initialization** - Optimizes memory usage by loading search indexes only when needed

Search matches the start of words

Because matching is forward (prefix) based, search finds the **start** of a word or token, not the middle — searching "berry" won't find "blueberry", and a hyphen starts a new token (so "ABC-XYZ" is found by "ABC" or "XYZ", but not "BCX"). For languages that don't separate words with spaces (e.g. Chinese, Japanese), tokenization is unreliable — search by **barcode or SKU** instead.

### How Search Works[​](#how-search-works "Direct link to How Search Works")

When you type in the search field, the POS:

1. **Tokenizes** your input into searchable terms
2. **Searches locally** stored product data first for instant results
3. **Queries the server** if no local matches are found, then downloads and stores new products for future searches
4. **Updates results** in real-time as you type

This approach ensures fast search performance while progressively building a complete local product database.

## Product Filtering[​](#product-filtering "Direct link to Product Filtering")

### Filter Bar[​](#filter-bar "Direct link to Filter Bar")

Below the search field, you'll find interactive filter toggles and dropdown menus that allow you to narrow down products by specific criteria.

### Available Filters[​](#available-filters "Direct link to Available Filters")

#### Stock Status[​](#stock-status "Direct link to Stock Status")

Filter products based on their inventory status:

* **In Stock** - Products with available inventory
* **Out of Stock** - Products with zero inventory
* **Backorder** - Products available for backorder

#### Featured Products[​](#featured-products "Direct link to Featured Products")

Toggle to show only products marked as "Featured" in your WooCommerce store.

#### On Sale Products[​](#on-sale-products "Direct link to On Sale Products")

Filter to display only products currently on sale or with active discounts.

#### Category[​](#category "Direct link to Category")

Use the category dropdown to filter products by their assigned product categories. This helps you quickly find products within specific departments or product lines.

#### Tag[​](#tag "Direct link to Tag")

Filter by product tags to find items with specific attributes or characteristics you've defined in your WooCommerce store.

### Using Filters[​](#using-filters "Direct link to Using Filters")

* **Toggle Filters** - Click any filter button to activate it (active filters appear highlighted)
* **Multiple Filters** - You can combine multiple filters to narrow your search further
* **Clear Filters** - Click an active filter again to deactivate it
* **Search + Filter** - Use filters together with the search field for precise product location

## Barcode Configuration[​](#barcode-configuration "Direct link to Barcode Configuration")

### Search Fields[​](#search-fields "Direct link to Search Fields")

The search functionality automatically includes your configured barcode field. The barcode field used for searching depends on your POS settings configuration.

## F.A.Q.[​](#faq "Direct link to F.A.Q.")

What is the \_global\_unique\_id field for barcodes?

The `_global_unique_id` field is a new barcode field that WooCommerce recently added to provide better barcode standardization across stores.

**Key Points:**

* **Modern Standard**: This field was designed specifically for global barcode identification
* **POS Configuration**: You can configure the POS to use `_global_unique_id` as the barcode field in the POS settings
* **Legacy vs. New**: The legacy barcode setting uses the `_sku` field, but this will change to `_global_unique_id` in future versions
* **Flexibility**: You can configure any product meta field as your barcode field if you're using third-party barcode plugins
* **One field per product**: The POS searches a single configured barcode field, and WooCommerce stores one barcode value per product (or per variation). If you need multiple codes on a product, store them in a custom field and point the barcode setting at it
* **Future Default**: `_global_unique_id` will become the default barcode field in future POS updates

To configure which field the POS uses for barcodes, visit your POS settings in the WordPress admin area.

Why don't I see all my products when I search?

WCPOS uses progressive product downloading to maintain performance. If you don't see a product:

1. **Try searching for it** - This will trigger the POS to look for it on your server
2. **Wait for download** - The POS will download the product and others in small batches
3. **Search again** - Once downloaded, the product will appear in future searches

This process ensures your POS remains fast and responsive even with thousands of products. Learn more about this in our [Product Synchronisation](/products/sync.md) guide.

Can I search for partial product names or SKUs?

Yes! The tokenized search uses forward matching, which means:

* Searching "blue" will find products with "blueberry", "blue shirt", etc.
* Searching "ABC" will find SKUs like "ABC123", "ABC-XYZ", etc.
* You don't need to type complete words or codes

The search is designed to find products quickly with minimal typing.
