bsearch_querybuilder is also known as an advanced query. It is a frontend plug-in. This plug-in provides a visual interface in which you can create complex queries without the need to write complex domain-specific language (DSL) statements.
- An Alibaba Cloud Elasticsearch V6.3 or V6.7 cluster is created.
For more information, see Create an Alibaba Cloud Elasticsearch cluster. This topic uses an Alibaba Cloud Elasticsearch V6.3 cluster as an example.
- The bsearch_querybuilder plug-in is installed.
For more information, see Install a Kibana plug-in.
- An index is created, and data is imported into the index.
For more information, see Quick start.
Query DSL is an open-source Java framework that is used to define SQL type-safe queries. It allows you to call API operations to send queries instead of writing statements. Query DSL supports JPA, JDO, SQL, Java Collections, RDF, Lucene, and Hibernate Search.
- Easy to learn: bsearch_querybuilder is a graphical tool. It allows you to create DSL queries with simple click and drag operations. You can customize search conditions without the need for complex coding, which reduces the cost of learning to write DSL statements. It also helps developers write and verify DSL statements.
- Easy to use: All queries that you have defined are stored in Kibana. These queries are ready for use at all times.
- Compact: bsearch_querybuilder only consumes about 14 MiB of disk space and does not stay resident in the memory. This means that the plug-in does not affect the performance of Kibana and Elasticsearch.
- Secure and reliable: bsearch_querybuilder does not rewrite, store, or forward user data. The source code of bsearch_querybuilder has passed the security auditing of Alibaba Cloud.
- Log on to the Kibana console of your Alibaba Cloud Elasticsearch cluster.For more information, see Log on to the Kibana console.
- In the left-side navigation pane, click Management and follow these steps to create an index pattern:Notice If you have created an index pattern, skip this step.
- In the Kibana section of the Management page, click Index Patterns.
- In the Create index pattern section, enter an index pattern name (the name of the index that you want to query).
- Click Next step.
- Click Create index pattern.
- In the left-side navigation pane, click Discover.
- In the top navigation bar of the Discover page, click Query.
- In the section that appears, select a search condition and a filter, and click Submit.
The bsearch_querybuilder plug-in allows you to create a variety of queries, such as fuzzy queries, boolean queries, and range queries. Examples:
- Click the button to add a search condition.
- Click the button to add a filter for the search condition.
- Click the button to delete a search condition or filter.
- Fuzzy query
As shown in the following figure, the email condition is added for a fuzzy match. The email condition matches all email addresses that contain the iga keyword.The following figure shows the returned result.
- Boolean query
As shown in the following figure, the index condition is set to tryme_book. An OR condition that contains multiple filters is also added to filter data by type. The type filters are set to Undergraduate teaching materials, Math, Foreign language teaching, and Undergraduate textbooks.The following figure shows the returned result.
- Range query
Range queries allow you to search data by date. As shown in the following figure, the range condition is used to filter data based on the utc_time field. Only data entries created within the specified time range are returned. The specified time range is
[Current time - 240 days, Current time].The following figure shows the returned result.