Configuration

Search behavior is controlled by both environment system settings and dynamic configuration that can be updated through the administration interface.

Dynamic Configuration (Real-time Updates)

These settings can be modified through the administration interface and take effect immediately without requiring code deployment:

  • SEARCH_DEFAULT_PAGE_SIZE: Default number of results per page. Used when page_size parameter is not provided. Must be an integer with a minimum value of 1 (default: 20)

  • MAX_IMAGE_DIMENSIONS: Maximum image dimensions for image search in pixels. Configured as an object with width and height properties (default: 2000x2000)

  • EXTERNAL_SEARCH_EXTENSION_CONFIG: Configuration for external search extension including enabled status, API credentials (username, password, host), extension class path, and result limits. When enabled, requires username, password, host, and klass fields

  • PRODUCT_STOCK_OUT_VISIBILITY_ENABLED: Controls whether out-of-stock products appear in search results. When enabled, out-of-stock products are displayed with "sold out" status on listing pages

  • HIDE_GROUPED_PRODUCTS_ON_SEARCH: Hides grouped products from search results when enabled. When active, during indexing, the product's "name" and "search" fields are set to empty strings in Elasticsearch, effectively removing them from search results

  • SEARCH_PRODUCT_EXTRACTION_STRATEGY: Strategy class path for extracting products from search results. Determines which products are returned when meta products and sub-products exist. Default: omnishop.search.strategies.DefaultProductExtractionStrategy

  • CATEGORY_PRODUCT_EXTRACTION_STRATEGY: Strategy class path for extracting products from category listings. Used when browsing category pages

  • OFFER_SHOW_LISTING_KWARGS: Controls whether basket offer listing arguments are included in product listing data. When enabled, offers with QUANTITY condition types will include listing_kwargs containing discounted pricing information (quantity, discounted_total_price, discount) for display on product listing pages. This allows showing discounted prices when customers purchase the required quantity (default: False)

Environment System Configuration (Requires Deployment)

These settings are configured in the application configuration and require code deployment to change:

  • SEARCH_DYNAMIC_FILTER_ACTIVE: Enables dynamic filter feature via HTTP headers. When enabled, allows filtering through X-Search-Dynamic-Filter and X-Search-Dynamic-Exclude headers. Also enables cache breaker functionality based on request context. (default: False)

  • SEARCH_FUZZY_SEARCH_ACTIVE: Enables fuzzy search for queries longer than 4 characters. When enabled, searches include approximate matches with typo tolerance (fuzziness: 1, prefix_length: 1) (default: False)

  • ES_MIN_SCORE_COEFFICIENT: Elasticsearch minimum score coefficient for relevance filtering. Products with scores below max_score * coefficient are excluded. Value of 0 disables score filtering (default: 0)

  • ES_MAJOR_VERSION: Elasticsearch major version. Affects query syntax and response format. Supported versions: 5, 8 (default: 5)

  • INDEX_PRODUCTS_PREFETCH_ENABLED: Enables prefetch optimization during product indexing to improve performance. When disabled, products are indexed without prefetching related data (default: True)

  • ELASTICSEARCH_IS_LISTABLE_FIELD_POPULATED: Indicates whether the listable field is populated in Elasticsearch. When true, enables additional filtering optimizations for listable products

Last updated

Was this helpful?