Elastic Search
How To Add LIKE Query In Elasticsearch?
Today I am going to share awesome tutorial of elastic search. in this tutorial i will show example of how to use LIKE query into elastic search.
- TAGS
- Elastic Search
- Search
- 4.5/5.0
- Last updated 10 September, 2022
- By Admin
I want to use LIKE query as work on sql, i mean If using a sql or mysql LIKE query to query data it will return data even if its only partially matched. if i search just codewale.com
then it will return all the records match codewale.com
. so you can add LIKE statement by using query_string
.
you can easily implement LIKE statement by using 'query_string', in following example you can see how to impletemt:
$search = 't'; $sql = json_decode(' { "type": "main", "query_cache": true, "body": { "size": 500, "query": { "query_string": { "default_field": "name", "query": "' . $search . ' OR *' . $search . '*", "use_dis_max": true, "fuzzy_max_expansions": 50, "fuzziness": 1 } } } } ');
I hope it can help you...
Categories
PHP
(5)
Codeigniter
(5)
Laravel
(3)
JS
(1)
Angular JS
(5)
Node JS
(5)
Vue JS
(4)
React JS
(6)
jQuery
(5)
Javascript
(3)
jQuery UI
(6)
Wordpress
(1)
Python
(5)
Database
(1)
MySql
(5)
Mongo DB
(1)
DBMS
(1)
SQL
(5)
HTML
(1)
HTML 5
(5)
CSS
(5)
Bootstrap
(5)
Ajax
(5)
JAVA
(1)
JSON
(5)
Ubuntu
(5)
Server
(5)
Git
(3)
Google
(1)
Google Map
(7)
Google API
(1)
Elastic Search
(1)
Apache
(1)
Installation
(1)