# Hybrid search with Java: LangChain4j Elasticsearch integration

DevFeed: [Hybrid search with Java: LangChain4j Elasticsearch integration](<https://devfeed.tech/articles/hybrid-search-with-java-langchain4j-elasticsearch-integration-78861.md>)

Original publisher: [Read original article](<https://www.elastic.co/search-labs/blog/langchain4j-elasticsearch-hybrid-search>)

Author: Laura Trotta

Published: 2026-03-11T00:00:00Z

Content type: tutorial

Language: en

Sources: [Elasticsearch Labs](<https://devfeed.tech/sources/elasticsearch-labs.md>)

Topics: [hybrid-search](<https://devfeed.tech/topics/hybrid-search.md>), [elasticsearch](<https://devfeed.tech/topics/elasticsearch.md>), [langchain4j](<https://devfeed.tech/topics/langchain4j.md>), [Java](<https://devfeed.tech/topics/java.md>)

Tags: [bm25](<https://devfeed.tech/tags/bm25.md>), [elasticsearch](<https://devfeed.tech/tags/elasticsearch.md>), [hybrid-search](<https://devfeed.tech/tags/hybrid-search.md>), [integrations](<https://devfeed.tech/tags/integrations.md>), [java](<https://devfeed.tech/tags/java.md>), [langchain4j](<https://devfeed.tech/tags/langchain4j.md>)

## AI overview

A hands-on Java tutorial builds a movie search application using LangChain4j, Elasticsearch, and Ollama. It compares vector-only retrieval with hybrid search combining BM25 and k-nearest-neighbor results through reciprocal rank fusion. In the time-loop movie query example, hybrid search surfaces more relevant titles, though results may still include some mismatches.

## Source excerpt

Learn how to use hybrid search in LangChain4j via its Elasticsearch integrations, with a complete Java example.