LighTech
Home
/
Blog
/
For Developers
/
Migration from OpenSearch to TypeSense using AI

How we migrated search from OpenSearch to TypeSense, exploiting AI, and survived

Migration from OpenSearch to TypeSense using AI

Sometimes the tasks in projects look very simple.… Until you start making them.

We had a project with an already implemented search on OpenSearch. Everything was working: indexes, filters, custom query logic — even its own "mini-ORM" above the search, through which the frontend sent complex queries.

And at some point, a decision came.: "Let's just replace OpenSearch with TypeSense."

Spoiler alert: it's never "easy".

Why did you decide to change OpenSearch to TypeSense

Why did we choose TypeSense
On paper, it looked logical — TypeSense is cheaper to operate. It seemed like a technical exchange without much loss.

The main problem: you can't break the front

The most important limitation is that the frontend should not notice any changes.

In other words, the API remains the same, the query structure remains the same, and the search behavior remains the same. And inside there is a completely different engine.
 

What did this mean in practice?

I needed to take queries tailored for OpenSearch, transform them, send them to TypeSense and return the result in the same format. In fact, it's about writing a full—fledged adapter between two different worlds.

Where things didn't go according to plan

Waiting: "Well, there's a client to change and fix a couple of requests."

Reality:

  • different approaches to filtering;
  • different query syntax;
  • different work with indexes;
  • different ranking logic.

The problem is that these aren't just different APIs—they're different search philosophies.

For example: OpenSearch has a flexible DSL that allows you to build queries of almost any complexity. TypeSense focuses on simplicity and speed, with a deliberately limited syntax. And simply "converting JSON" doesn't work — you need to rethink the query logic entirely.

What really had to be rewritten

In fact, query generation, filtering, aggregations and their analogues had to be redone in TypeSense, working with indexes and auxiliary utilities. And all this while maintaining a 1:1 behavior, without the right to regress, because the front should not have felt the difference.

Tight deadlines and a bit of pain

Classic of the genre: the time for the task was greatly underestimated at the planning stage. And that's where the fun begins.

Where AI really helped

Without an AI assistant, I would not have completed this task on time. Seriously.

The AI in this case played several roles at once:

  • live documentation;
  • mentor on an unfamiliar technology;
  • code reviewer;
  • a blank generator for a specific task.

Moreover, you can ask "dumb" questions, ask to explain concepts, compare approaches and generate code — and he does not get tired, does not get annoyed and responds instantly.
 

How it looked in practice

I literally disassembled a piece of OpenSearch logic, asked how to implement it in TypeSense, received an adapter, tested it, found discrepancies, returned with clarified questions - and repeated. And so on dozens of times, iteration after iteration, until the behavior matched.

Important insight

Previously, the new technology meant: "we need a specialist with experience in this particular stack," but now the formula has changed: "we need time and well—formulated questions." AI greatly reduces the threshold of entry into an unfamiliar area.

Analogy (vital)

You can imagine it this way: AI is like a friend you invited to a showdown. He fights really well, BUT:
Meme about AI
  • Sometimes it gets stupid.;
  • Sometimes he gets distracted; 
  • it happens that he runs ahead of the locomotive;
  • the answer is buttered butter.

If you spice it up with a good hint and clearly indicate who to beat, it really helps. And most importantly: there are already two of you.

Conclusions

1. Replacing the search engine is not replacing the client, it is replacing the architecture.

2. Different search engines are different philosophies, not just different syntax.

3. The most difficult thing is to keep the 1:1 behavior unchanged on the consumer side.

4. AI is not a toy, but a real working tool that is already changing the way we solve complex problems.


The main idea

If you encounter a new technology, there is no need to panic and you do not need to urgently look for a "senior with 10 years of experience in this particular stack." It is enough to understand the basic principles, use AI as a partner, and methodically move iteration after iteration.

Result

Yes, I'm burned out. Yes, it was difficult. But without AI, it would have been much longer and more painful. And time, as you know, is money.

Frequent questions

Is it possible to migrate from OpenSearch to TypeSense without changes on the front-end side?
Is it really possible to master a new technology in a short time without a specialized specialist?

Share

Discuss the project with the LighTech team

Book an appointment

Our Projects

Tell us about your project
Name
Contact
Message
Attach file +
Request to get files
Name
Send files
Message
Thanks!
Your request has been sent
After processing, our manager will contact you