For many applications and websites, which obviously are not designed only to represent your business, the search function is one of the most important tools. Search can be a primary tool for customer interaction because it is a source of knowledge of what your users seek for on your site or application. By analyzing users searches, you can improve usability, provide more relevant functionality to attract new users and keep existing ones. As for the users, they like the search for at least two reasons:
- They do not need to put a lot of effort to find something. For example, if your web site is pretty big and a user needs to have a lot of clicks to get down to the desired content, this would quickly alienate them from using.
- It is a users lifebuoy, who are not able to understand user interface of your solution and just got stuck in navigation. In most cases, this also happens when you have a big solution with a lot of content, tabs, navigation, etc.
The search functionality can be represented as a small input on the page, but this small thing can improve your site usability, increase the number of customers and help your business, which is the primary goal after all. That is why efficiency is one of the key characteristics of the search. No matter, how your search is useful and powerful if the user waits for a long time or the level of relevance is too low, this will produce a wrong impression.
Obviously, it is hard to find a one-for-all solution. With a wide range of functions, different pricing, and more to compare, each service is a good choice depending on your needs. In the first part of the article, we try to review and compare two very popular search-as-a-services: Microsoft (MS) Azure Search and Elasticsearch (ES). In the second part, we review Azure Search in practice.
Microsoft Azure Search overview
Azure Search is a robust search-as-a-service cloud solution developed by Microsoft Corporation. Its release took place in 2013 when Microsoft announced new features of Azure, including the new Azure Search. One of the powerful Azure Search capabilities is using artificial intelligence abilities to extract text and features from image files, or entities and key phrases from raw text. Functionality is exposed through the aid of common API calls or .NET SDK (which also makes work with search easier and masks the complexity of information retrieval).
Azure Search provides a lot of features, including search suggestions, faceted navigation, filters, hit highlighting, sorting, paging, etc. Here is a short overview of them:
- Full text search and text analysis, the basic use case. Query syntax provides the set of operators, such as logical, phrase search, suffix, and precedence operators, and also includes fuzzy and proximity searches, term boosting, and regular expressions.
- Cognitive search, this functionality is in preview mode (please note, that this information is valid at the time of writing the article). It was designed to allow image and text analysis, which can be applied to an indexing pipeline to extract text information from raw content with the help of AI-powered algorithms.
- Data integration, Azure Search provides the ability to use indexers to automatically crawl Azure SQL Database, Azure Cosmos DB, or Azure Blob storage for searchable content. Azure Blob indexers can perform a text search in the documents (including Microsoft Office, PDF, and HTML documents).
- Linguistic analysis, you can use custom lexical analyzers and language analyzers from Lucene or Microsoft for complex search queries using phonetic matching and regular expressions or for handling (like gender, irregular plural nouns, word-breaking, and more).
- Geo-search, functionality to search for information by geographic locations or order the search results based on their proximity to a physical location that can be beneficial for the end users.
- User experience features, includes everything that facilitates user interaction with search functionality: auto-complete (preview), search suggestions, associating equivalent terms by synonyms, faceted navigation (which can be used as the code behind a categories list or for self-directed filtering), hit highlighting, sorting, paging and throttling results.
- Relevance, the key benefit of which is scoring profiles to model the relevance of values in the documents. For example, you can use it, if you want to show hot vacancies higher in the search results.
Azure Search also provides such helpful tools as search traffic analytics, register metrics on queries per second, per latency, and throttling. Through the Azure portal you also can easily monitor your analytics, index and document counts, manage capacity, and much more. The highly available platform ensures an extremely reliable search service experience, offering 99.9% SLA.
Elasticsearch overview
Elasticsearch is employed for a lot of different use cases, that will be briefly reviewed further on in this paragraph. It was founded in 2012 by Shay Banon and the main idea was to create a scalable search solution, which then replaced the Compass – a precursor of Elasticsearch. So, let us review a little what Elasticsearch is all about.
Elasticsearch is a document-oriented database designed to store, retrieve, and manage document-oriented or semi-structured data. It can be used to search for all kinds of documents and supplies scalable search and supports multi-tenancy. Elasticsearch provides access to all functionality via a REST interface, so, you store data in JSON document, then, you query them for retrieval. Elasticsearch is also schema-less, using some defaults to index the data. The primary features of Elasticsearch are:
- Textual Search, this is the most common use case, and primarily Elasticsearch is used where there is lots of text, and the goal is to find any data for the best match with a specific phrase.
- Text search and structured data allows you to search product by properties and name.
- Data Aggregation, as it is mentioned in official documentation, the aggregation’s framework helps provide aggregated data based on a search query. It is based on simple building blocks called aggregations, that can be composed in order to build complex summaries of the data. There are many different types of aggregations, each with its own purpose and output.
- JSON document storage represents a JSON object with some data, which is the basic information unit in Elasticsearch that can be indexed.
- Geo Search provides the ability to combine geo and search. Such functionality is slowly becoming a must have for any content website.
- Auto Suggest is also one of the very popular functions nowadays, which allows the user to receive suggested queries as they type.
- Autocomplete this is one of the very helpful functions, which autocompletes the search field on partially-typed words, based on the previous searches.
Elasticsearch is not new and has a lot of common functions with Azure Search (which is pretty logical as they both provide search facilities), but it is evolving rapidly and working on an increasing number of functions. The main goal of these two services is clear and consistent and directed to allow achieving faster performance with search results for your search engine. Let us try comparing them by some of the features.
Azure Search vs Elasticsearch
The selection process is a truly individual process that depends on many factors, mainly on your goals and project. Further on in the article, we are going to compare Azure Search and Elasticsearch in a general manner, which will cover the main functionality and common properties. Anyway, you just need to keep in mind that while comparing you should not only explore their features list and price but understand that selected solution must match your standards and project needs. It may also be a good idea to think a little about your future plans. As an example, at the outset of work on your application or service, you want to have an only English version of the site, but you know for sure that sometime after, you plan multilanguage integration, so you need to be sure that the selected platform will always match your needs. Sometimes, it is difficult to choose the more expensive option right away, when your project is still small, but this will save you in the future from migration to another platform.
Supported languages
Multilingual applications are not rare and sometimes have specific requirements to the supported languages (for example, support of a specific language is required). The table below shows the list of supported languages for both services. Please note that this list is valid at the moment of writing the article and was received from official websites.
Language | ||
---|---|---|
Arabic | ||
Armenian | ||
Bangla | ||
Basque | ||
Bengali | ||
Brazilian | ||
Bulgarian | ||
Catalan | ||
Chinese | ||
Croatian | ||
Czech | ||
Danish | ||
Dutch | ||
English | ||
Estonian | ||
Finnish | ||
French | ||
Galician | ||
German | ||
Greek | ||
Gujarati | ||
Hebrew | ||
Hindi | ||
Hungarian | ||
Icelandic | ||
Indonesian | ||
Irish | ||
Italian | ||
Japanese | ||
Kannada | ||
Korean | ||
Latvian | ||
Lithuanian | ||
Malayalam | ||
Malay (Latin) | ||
Marathi | ||
Norwegian | ||
Persian | ||
Polish | ||
Portuguese | ||
Punjabi | ||
Romanian | ||
Russian | ||
Serbian | ||
Slovak | ||
Slovenian | ||
Sorani | ||
Spanish | ||
Swedish | ||
Tamil | ||
Telugu | ||
Thai | ||
Turkish | ||
Ukrainian | ||
Urdu | ||
Vietnamese |
Price
The price is always a pretty difficult thing to compare. These two services have different payment types and different plans. In the table below we tried to show the comparison considering the most popular questions on payment like payment types (monthly, annually, and so on), trial periods, etc.
Free Tier | ||
Monthly payment | ||
One-time payment | ||
Annual Subscription | ||
Starting price (per hour) | $0.101 | Depends on selected configuration |
Trial period | No need because of free tier availability | 14 days |
If you review the table carefully, you will mention that some points do not have clear answers. For example, Elasticsearch does not provide the exact price for each configuration, because it allows you to set up infrastructure: deployment size, choice of cloud provider (AWS or GCP), number of availability zones, and deployment type, which have a big impact on the price. Azure Search does not have a trial period but it has a free tier, which is not time-limited on use. That is why comparing the price you need to think about what would better suit your solution and what plans you have on the start point (use free plan or trial period, configure all by yourself or use the configured plans, etc).
Supported data types
Supported data types can be also a delicate issue when you research the opportunities of each service. Below in the table we show the types supported by Azure Search and Elasticsearch with some additional notes. Please note, that some of the data types can be replaced by others, so review the table carefully.
string | ||
Collection (String) |
A list of strings that can optionally be tokenized for full-text search. The recommended limit is 16 MB. | Elasticsearch has separate data types for storing arrays. |
boolean | ||
integer | 32-bit integer values (Int32) and 64-bit integer values (Int64) | |
long | ||
short | ||
byte | ||
binary | ||
double | ||
float | ||
half_float | ||
scaled_float | ||
date | Date time values represented in the OData V4 format. | |
GeographyPoint | ||
geo_shape for complex shapes like polygons | Azure Search actually has GeographyPolygon type, which is a polygon representing a geographic region on the globe. This type cannot be used in document fields but can be used as an argument. | |
Range datatypes | integer_range, float_range, long_range, double_range, date_range | |
Complex datatype | array, object, nested | |
IP datatype | ||
Completion | Azure search has a separate | completion to provide |
datatype | function for this | auto-complete suggestions |
Token count datatype | to count the number of tokens in a string | |
mapper-murmur3 | to compute hashes of values at index-time and store them in the index | |
mapper-annotated-text | to index text containing special markup (typically used for identifying named entities) | |
Percolator type | accepts queries from the query-dsl | |
join datatype | defines parent/child relation for documents within the same index | |
Alias datatype | defines an alias to an existing field. |
Programming interfaces
Supported programming interfaces may be one of the major dependencies. In this paragraph, we will not compare these services in a table, but provide a list of available interfaces for each of them. The following programming interfaces are available for the Azure Search:
- REST – HTTP commands supported by any programming platform and language, which makes this interface universal.
- .NET SDK – .NET wrapper for the REST API offers available for managed-code languages targeting the .NET Framework.
- Azure Search libraries for Python, which are provided through Azure SDK for Python.
Elasticsearch has a broader list of supported clients, and also a list of community contributed clients but in this article, we will review only official clients, that are listed below:
- Java REST Client.
- Java API.
- JavaScript API.
- Groovy API.
- .NET API.
- PHP API.
- Perl API.
- Python API.
- Ruby API.
Despite a broader support, Azure Search provides REST API, which also makes it available for a broader list of languages.
Import data source
Both of the services allow importing data from different sources. Sometimes it is very useful, especially when you have an existing project and need to move your data to the index. Azure Search supports the next list of the data sources:
- Existing data source. You can select existing indexers defined in your search service.
- Azure SQL Database.
- SQL Server on Azure VM.
- Azure Cosmos DB.
- Azure Blob Storage.
- Azure Table Storage.
Through the Java Database Connection (JDBC) importer you can fetch data from JDBC sources for indexing into Elasticsearch. It supports the next sources:
- PostgreSQL.
- MS SQL Server.
- MySQL.
- Exporting from CSV files.
Also, both services allow pushing any dataset composed of JSON documents to the index.
Summary
In this article, we have compared a few quite common parameters to display some difference between the services. Despite all articles and comparisons, you need to remember that you should not restrict yourself to what experts have to say when you pick a solution that you believe will work best for your team. It is an individual process and sometimes the right choice varies, depending on specific preferences, work processes, and your business needs. That is why we hope, that you have found something relevant to your needs, and get closer to make an informed decision or, at least, found something new for yourself. For those, who after reading this article became interested in Azure Search, it might be interesting to see the second part of the article, where we will provide some examples of its usage.
About Redwerk
Redwerk team has been on the market since 2005. Over the years our dedicated development team accomplished 250+ projects for clients from all over the world. We have a credible portfolio of case study on outsourcing services we provided, that shows our expertise in various technologies and industries. Furthermore, most customers are in long-term cooperation with us because of the high-quality IT outsource service we provide with. Our team is always up with trends and guarantees the best result for each project we deal with.