> 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="/files/dcEnrWZdwyCYHDTg1uvN" 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="/files/XV93fsyLI0etgnt7GFGT" 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
