The search feature in Pega help us retrieve results. This result can be retrieved in 2 ways.
Directly from database
From search engine
From Pega 7.1.7 , it began supporting search using elastic search running on an embedded technology within Pega deployment using the same JVM.
Elastic Search
Elastic search is a real-time distributed open-source full-text search and analysis engine. It's used in single-page applications.
Its developed in Java
Its Apache lucene Based Search Server ( lucene is a Java Library)
Elastic search is a JSON based distributed web server built over lucene . Though its lucene who is doing the actual work beneath, elastic search provides us a convenient layer over lucene .
Elastic search is built over lucene and provides a JSON-based REST API to refer lucence feature.
Elastic search provides a distributed system on top of lucene . A distributed system is not something lucene is aware of or built for . Elastic search provides the abstraction of a distributed system.
Elastic search provides other supporting features like thread pooling, node/cluster monitoring API, and data monitoring API .
Elastic search is accessible from a Restful web service interface and uses schema-less JSON.
The key components of Elastic search are:
Lucene: a full-text search library that is used to index and search data.
Cluster: a collection of one or more nodes (servers) that together hold all of the data in the Elasticsearch index.
Node: a single server that is part of an Elasticsearch cluster, stores data, and participates in the cluster's indexing and search capabilities.
Index: a collection of documents that have similar characteristics.
Document: a JSON object that represents a piece of data in Elasticsearch.
Shard: a slice of an index that can be stored on a single node. Indices are divided into shards in order to distribute data across multiple nodes and improve performance.
Replica: a copy of a shard that provides redundancy and improves the availability of data in the event of a node failure.
Comparison between Elasticsearch and RDBMS
Implementation
To improve report generation performance, you can run report definitions against Elasticsearch indexes instead of using SQL queries directly against the database. Running report definitions against Elasticsearch indexes is disabled by default and does not apply to reports that have features that are not supported by Elasticsearch. If a report query cannot be run against Elasticsearch indexes, Pega Platform automatically uses an SQL query.
As a pe rquisite, we have to do the below things.
Enable the below DSS
The below queue is up and running
Step 1 | Create a data type. |
Step 2 | Create a dedicated index. System > Custom Search Proprieties |
Step 3 | Enable the search index. Settings > Search > Dedicated Index |
Step 4 | Create a report definition . |
Step 5 | Enable elastic search |
Execute, it -
Pega will first try to retrieve the data from Search Data , if it is not available then only it will go to the database table.
Disadvantage of Elastic Search
Elastic search does not have multi language support in terms of handling request & response data ( Only Possible in JSON) Unlike Apache Solar , where it is possible in CSV,XML and JSON formats .
Occasionally Elastic search has problem with Split Brain solution.
A split brain situation in a distributed system occurs when different parts of the cluster have different views of the system's current state. This can happen when network partitions occur, causing different parts of the cluster to lose communication with each other. To prevent data loss or corruption, it is important to have a split brain solution in place.
One common solution to split brain is to use a quorum-based approach, where a majority of the nodes in the cluster must be in agreement before any changes can be made to the system's state. For example, in a three-node cluster, two of the nodes must agree on a new state before it can be committed.
Another solution is to use an elected leader node that is responsible for making decisions on the cluster state. This approach ensures that there is only one node that can make decisions, avoiding conflicts that can occur in a quorum-based approach.
Conclusion
Pega Elasticsearch is an integration of Elasticsearch with the Pega platform. Pega Elasticsearch allows users to index and search through large amounts of data stored within the Pega platform. This integration allows users to perform advanced full-text searches, faceted navigation, and real-time analytics on data stored in Pega.
The integration of Elasticsearch with Pega allows users to:
Search and retrieve data from Pega quickly and easily
Perform advanced search capabilities, such as faceted navigation, geospatial search and text analytics
Analyze and visualize data in real-time with the help of Kibana
Scale up or down as per the requirement
Perform near real-time data indexing
Improve the overall performance of Pega application with the help of Elasticsearch
Enhance user experience by providing relevant search results
This integration helps organizations to improve their decision-making capabilities by providing them with accurate and relevant data in real-time, and also helps in improving the overall performance of Pega applications.
Comments