Introducing Basic Flexible Search Syntax

Objectives

After completing this lesson, you will be able to:

  • Explain the major features of Flexible Search

Key Features of Flexible Search

Flexible Search is a built-in query language using an SQL-based syntax. Let's check out some of its basic features.

Primarily, Flexible Search is based on SQL and enables you to search for and retrieve items in the SAP Commerce domain. Note that only select operations are permissible.

Flexible search:

  • Allows you to express your query using SAP Commerce types and attributes. Hence, you don't need to manage the core database tables and their respective columns directly.
  • Transforms your type-based query into an underlying table-based query, effectively separating your application logic from database storage particulars.

When you execute Flexible Search from the HAC's Flexible Search Console, the system returns data results in a usual query format, similar to executing an SQL query. You often need joins and/or sub-queries for linked objects.

This diagram illustrates the basic query progress of Flexible Search.

Second, as for the previous diagram, you can frequently execute Flexible Search queries from Java or Groovy using the FlexibleSearchService API. This method lets you gather a collection of 'whole objects'. In the Java domain, these whole objects are a java.util.List of model-class instances (for example, ProductModel or UserModel) that correspond to the Commerce Type queried. Typically, these queries use value parameters and don't require joins. The reason is that you can program linked objects to traverse or navigate afterward as needed.

Lastly, since Flexible Search is fundamentally based on SQL, almost all SQL features are operational. We cover this topic in more detail in the upcoming lesson 'Flexible Search Syntax'.

Log in to track your progress & complete quizzes