Elasticsearch: 3 Awesome Unknown features You Must Check Out Today.

Photo by Andrea Piacquadio from Pexels

1- Search-As-You-Type Field Type

I’m pretty sure you’ve seen and used autocomplete features on a lot of websites, social media, simple and advanced web applications like Google, Facebook, Amazon, Tiktok, and so on.

2- N-gram

I’m quite sure that you came across the same search issue I went through in the earlier days of my journey working with Elasticsearch. Let me show you something.

{
"title": "How Trump became a president.",
"description": "You'd better do something else than trying to figure it out",
"date": "2005-04-04"
}
curl -XGET -H "Content-Type: application/json" "127.0.0.1:9200/articles/_search?pretty" -d 
'{
"query": {
"term": {
"title": "Trum"
}
}
}'

3- Highlighting

As Elasticsearch users, we got accustomed to those autocompletion entries containing bold parts while typing either in a search engine search bar or a browser search bar. Do you know that Elasticsearch allows you to do this on every query you make without any required customization from your side (front or backend)?

GET /_search
{
"query": {
"match": { "tag": "youtube" }
},
"highlight": {
"fields": {
"content": {}
}
}
}

Conclusion

In this article, we walked through three less known but nice features Elasticsearch offers to engineers.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store