Site-based filters allow you to segregate sites that share the same MDEX engine. If only a subset of records within the MDEX engine are relevant for a specific site in your application, then you can specify site-based filters. If you do not use filters for your sites, then all sites share a dataset and differ from each other only their presentation.
The site-based filter is applied to all queries performed on the site. The filter that is applied is determined by the current site. For example, the Discover Electronics application could have two additional sites: DiscoverCameras and DiscoverPrinters. DiscoverCameras is a site where end users can buy cameras, while DiscoverPrinters is a site where end users can buy printers. You can configure site-based filters that determine which records are appropriate for each site. Even though the shared index has both cameras and printers, a shopper only sees products that are relevant for the site they are visiting.
Site-based filters are defined in the
filterState.xml
file. Each site that requires site-based
filtering should have a
filterState.xml
. You can define record filters in the
filterState.xml
file. Record filter syntax is described
in the
MDEX Engine Developer's Guide. The Discover Electronics
reference application could have a site-based filter in the following location:
.
Site filtering does not allow configuring navigation filters and EQL filters.
<app_name>
/config/import/pages/<site_ID>
/filterState.xml
Example 1. Example of filterState.xml file
The following
filterState.xml
file shows a configuration with a
record filter that only includes records in the camera category.
<Item class="com.endeca.infront.navigation.model.FilterState" xmlns="http://endeca.com/schema/xavia/2010"> <Property name=recordFilters"> <List> <String>product.category:cameras</String> </List> </Property> </Item>