Searching with wildcards

In version 5.0.0.0 of KonaKart, the search constraints for most objects are paired with a search rule that can be configured in order to determine whether a wildcard is added before, after or before and after the search string. These "rule" attributes can be set when making the API call that searches for products, orders, customers etc.

The admin application has a properties file called konakartadmin_gwt.properties which is used to configure the search rules for the various panels of the Admin App.


# --------------------------------------------------------------------
# Default wild card settings for the Admin GWT Application
# --------------------------------------------------------------------
#
# Allows you to set wild card settings when searching
# for data using the Admin App. The accepted values are:
#
#    SEARCH_EXACT = 0;
#    SEARCH_ADD_WILDCARD_BEFORE = 1;
#    SEARCH_ADD_WILDCARD_AFTER = 2;
#    SEARCH_ADD_WILDCARD_BEFORE_AND_AFTER = 3;
#    SEARCH_USE_GLOBAL_CONFIG = 4;
#
# When set to 4, the search parameters will use the global settings 
# defined by the configuration variables: ADMIN_APP_ADD_WILDCARD_BEFORE
# and ADMIN_APP_ADD_WILDCARD_AFTER. The global settings will also be used if 
# this file is not found.
# If not set the default value is 4 (SEARCH_USE_GLOBAL_CONFIG).
#------------------------------------------------------------------------------

#sr.address.company.name      = 4

#sr.address.format            = 4
#sr.address.summary.format    = 4

#sr.catalog.name              = 4

#sr.country.iso2              = 4
#sr.country.iso3              = 4
#sr.country.name              = 4

#sr.coupon.code               = 4
#sr.coupon.name               = 4

#sr.currency.name             = 4

#sr.customer.email            = 4
#sr.customer.city             = 4
#sr.customer.first.name       = 4
#sr.customer.last.name        = 4
#sr.customer.postcode         = 4
#sr.customer.street           = 4

etc. etc.
                  

Note: Prior to v6.6.0.0 these parameters were defined in a file called AdminSearchRules.properties which is no longer used.

As can be seen in the example above, there are various rules such as SEARCH_EXACT and SEARCH_ADD_WILDCARD_BEFORE etc. which map to integer values. If for example I want to be able to search for customers using the customer last name with a trailing wildcard, I must set:

sr.customer.last.name = 2

Before version 5.0.0.0, there were global configuration variables for the admin app called:

These variables still exist and will be used when the rules are set to the value SEARCH_USE_GLOBAL_CONFIG, which is the default case for backwards compatibility.