Search

Search

 

Introduction

Search integration enables data searching in the indexed columns of the tables in your Catalyst Data Store. When you implement Catalyst search in your application, the end users will be able to perform powerful searches through volumes of data in your Data Store with a single search query. 

Catalyst search is available in both Java and Node.js programming environments for your web application. You can copy the ready-made code template available for Java, Node.js, and Web.js from the Catalyst console and implement it in your application's code wherever required. You can also make any column of any table in the Data Store available or unavailable for processing in the search query by easily indexing or un-indexing the column from the Data Store.

You can execute search queries from your application using Catalyst API. To learn more, refer to the SDK documentation and the API documentation.

 

Purpose

Performing a conventional search in a high-volume database containing a substantial number of data records is time-consuming and tedious. Although you can use joins in SQL to combine records from two or more tables, you can still only search based on the related column which links them. You will not be able to provide a powerful search feature for ZCQL queries in Catalyst.  

In an application where a large number of search queries are executed on a sub-second basis, it is very difficult to build a system that can handle the heavy amount of data processing. It requires a lot of effort to construct and implement a data search logic from scratch. This is also a memory-intensive and a highly expensive process, that involves strenuous efforts on the developer's part. In these cases, you can integrate Catalyst's readily available code template in your application's backend and let Catalyst handle the search processing.   

 

Key Concepts

Before you learn about implementing search in your application, it's important to familiarize yourself with some fundamental concepts. 

Indexed Columns

As mentioned earlier, Catalyst Search is only available for columns whose Search Index constraint is enabled in the Data Store. If a column is not indexed, that is, if the Search Index constraint for the column is disabled, the search query cannot access the column. It will not be able to obtain the column's value for a record in the table. 

To enable search for a particular column in a table, you must ensure that it is an indexed column. 

You can enable the Search Index constraint for a column when you create it. Refer to the Data Store documentation for information on creating a new column. 

 

Indexing an Existing Column in the Data Store

To enable the Search Index constraint for an existing column in a table in the Data Store:

  1. Navigate to Develop and then Data Store.
  2. Click the table's name from the list.
  3. In the Schema View section, click the ellipsis icon corresponding to the required column and click Edit.
  4. Enable the Search Index toggle switch.
  5. Click Update.

This will initiate the indexing process. Once the indexing is complete, you will receive a notification in your console alerting you of its success or failure. After the column is indexed, it can be accessed by search queries from your application. You can check whether a column is search indexed from the Schema View page. 

You can disable the Search Index constraint for an existing column in the same way.

Note: The Search Index constraint is automatically disabled for the default column ROWID and automatically enabled for the other default columns (CREATORID, CREATEDTIME, and MODIFIEDTIME). You cannot modify these values.
 

Benefits

  1. Powerful and Efficient Search
    Catalyst can execute the search process in the indexed columns of up to 25 tables per search query, returning up to 500 data records in a single instance. Additionally, this search process executes with minimal latency and provides the user with a quick response, no matter how big the database is. 
  2. Cost-Effective
    Catalyst search integration is highly cost effective as it eliminates the need for you to construct a search logic on your own. It reduces manual effort on your part, saving you a significant amount of time and investment in resources. Catalyst search provides a fail-safe mechanism with its powerful architecture for a substantially lower cost than most other services.  
  3. Enhanced User Experience
    Catalyst search allows data to be available in one place for the end users of your application when they execute the search query. Because of its high performance with reduced waiting time and response time, Catalyst search operations speed up the application performance significantly. This efficient feature therefore enhances the user experience for your application.
  4. Customizable Search Code Templates
    Catalyst search code templates are highly useful and allow you to tailor them to suit your application's logic and design. You can build customized search operations with the code that Catalyst provides, such as searching for multiple columns of multiple tables in one query, searching for records that begin with a particular alphabet, sorting the search results, and more. Refer to the Implementation section for more information.
  5. Auto Scaling
    Catalyst servers can auto-scale to provide the required space and resources when the application load increases. They maintain the consistency of their performance and scale up the data tiers based on the application's fluctuating needs. Auto scaling ensures that your application stays reliable and it reduces app failures significantly.
  6. Fully-Managed Backend
    You can implement Catalyst search without having to manage or handle its architecture directly. This saves you from handling the servers, setting up and configuring the environment, or manually customizing logic for your requirements. Zoho handles all the backend functionalities and takes care of all the behind-the-scenes activities.
  7. Ease of Access
    As mentioned earlier, Catalyst search can easily be integrated into the application by copying a ready-made code template from the console. This template is available for all the programming environments. You can simply use the code template for the programming environment you used to develop the server-side functionalities in your application.
 

Use Cases

Catalyst Search can be used in the following scenarios:

  • An e-commerce application that contains a search bar in the UI where the end users can search for a particular product. The user's single search query should be able to retrieve records from all available product categories in the inventory. The scope of the search is a vast area of the product database. These search queries with heavy loads can be processed quickly and efficiently using Catalyst search. The user receives the results of their search with minimal response time.
  • A contact directory application that requires to process customized search, such as sorting the search results based on a certain criteria or allowing the user to look up records starting with a particular alphabet, can implement Catalyst search. The customizable code allows the application developer to tailor Catalyst logic to suit their requirements.
 

Implementation

As mentioned before, the Catalyst console provides search integration code templates for Node.jsJava, and Web.js programming environments. 

To access the code template for search integration from the Catalyst console:

  1. Navigate to Amplify and then Search.
  2. Click the required programming environment tab.
  3. Copy the code template from the code window and paste it in your application's source.

The values for ProjectID, Project Domain ID, and other unique identifiers are pre-populated in the code template for your application.

You will need to replace the values of some variables in the code template. These variables are:

  • ${searchword}: Indicates the keyword or keywords to search for
  • ${column_name}: Indicates the name of the indexed column to be searched
  • ${table_name}: Indicates the name of the table to be searched

You must insert your application's logic, such as the processing and error logic, in the relevant parts of the code. These places are indicated by comments in the code template. When you implement the final code in your application, it will process search queries.

Some key points about the functionalities of Catalyst search include:

  1. You can search in multiple table names and column names for a record or a set of records by adding multiple values for ${column_name} or ${table_name}
  2. You can search for a record by providing one or more keywords in ${searchword}. If you perform a search for two or more keywords using spaces between them, the records for each keyword will be returned in the result set. For example, if you search for "Zylker Corporation", the search query returns will contain results that are relevant to either "Zylker" or "Corporation".
  3. You can perform a search by specifying a character and ending with an asterisk (*), to return all data records that start with the specified letter. For example, if you enter the value for the ${searchword} as "c*", the search query will return all the records that begin with 'c'.  
  4. You can also sort the result set in ascending or descending order using sortBy.

The Enable Data Searching page also displays a list of all indexed columns in every table in the Data Store. 

The columns are grouped into sections by table, and the DataType of the columns is also displayed for your ease of reference.

Share this post : FacebookTwitter

Still can't find what you're looking for?

Write to us: support@zohocatalyst.com