We mentioned that Elasticsearch is a search engine in the article “What is Elasticsearch“. Searching for a keyword in Elasticsearch is very fast. In this article we will talk about the search types in elasticsearch. You may want to read the following articles before reading this article.
“How To Install Elasticsearch On Centos“,
“How To Install Kibana On Centos”
We’re connecting to Kibana for keyword search and we click on Discover and Relative from Time Range as you see in the screenshot below. If the data you export to elasticsearch has a date column, you will see a screen as follows.
In the following screenshot, we indicate that we will search within the last 15 minutes.
If you click Quick from Time Range, the following options are available.
If you click Absolute from Time Range, you can select the time interval you want to search for from a calendar.
Then, type the keyword you want to search in the marked field in the following screenshot, and press enter. The found keywords will be listed in yellow as below.
Search Types
Search for a keyword in all data
If you type the keyword you’re looking for in the search section, it searches for the relevant keyword in all data.
Search for a keyword in a specific column
If you type column_name: keyword
in the search section, it will search only the related keyword in the corresponding column.
Example:
1 | fileset.name:syslog |
Search With AND && OR Operators
You can use AND and OR operators as follows.
1 | fileset.name:syslog AND fileset.module=system |
1 | fileset.name:syslog OR fileset.module=system |
LIKE Usage
You must type the keyword you want to search between two asterisks.
1 | *sys* |
You can also search in a specific column in the following way.
1 | fileset.name:*sys* |