> For the complete documentation index, see [llms.txt](https://knowlg.sunbird.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://knowlg.sunbird.org/learn/product-and-developer-guide/assets-search-service/architecture-1.md).

# Architecture

The below diagram represents the components involved and their arrangement in **Search** service.

1. The **search service** module has a play application and its internal actor module.&#x20;
2. By leveraging **Elasticsearch**, we can deliver an efficient and robust search experience to our users, ensuring that our application performs exceptionally well and remains flexible to adapt to future needs.
3. By leveraging **Flink(Async Jobs)**, we enable real-time and batch data processing with low latency, high throughput, and fault tolerance.

<figure><img src="https://1767651289-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaanfWbeVT74C5lXDPde3%2Fuploads%2FX0xNAPL4BsHGxoMYQQYw%2Fasset-search-architecture.png?alt=media&amp;token=ea70c54a-8726-4581-9d34-33d1370aa5a7" alt=""><figcaption><p>Search Architecture</p></figcaption></figure>

## Flow-diagram

With the content/collection APIs, we have the ability to create or update assets (content/collection). These assets are stored in Neo4j, and to track any transactions, we've implemented custom [neo4j-extensions](https://github.com/Sunbird-Knowlg/knowledge-platform-db-extensions) that generate transaction logs and store them in log files associated with asset changes in Neo4j.

To process these transaction logs and ensure their real-time availability, we employ Logstash to read the logs from the files and push them to the transaction events Kafka topic. Subsequently, we use a Flink job to consume and process these events, finally storing them in Elasticsearch for further analysis and querying.&#x20;

<figure><img src="https://1767651289-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaanfWbeVT74C5lXDPde3%2Fuploads%2FmC4BxbXCNuIYhFXm9oZL%2Fsearch-service-flow-diagram.png?alt=media&amp;token=e4bc87eb-e0c8-4840-85f6-2d8846bd4e7c" alt=""><figcaption><p>Search Service flow diagram</p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://knowlg.sunbird.org/learn/product-and-developer-guide/assets-search-service/architecture-1.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
