Elasticsearch Partial Search

match and match_phrase do not work for partial searches. We can use wildcard, query_string or regexp to match a partial string.

For example, search gt3p in the content column.

wildcard

{
"query": {
"wildcard": {
"content" : "*gt3p*"
}
}
}

query_string

{
"query": {
"query_string": {
"default_field": "content",
"query": "*gt3p*"
}
}
}

regexp

{
"query": {
"regexp": {
"content": ".*gt3p.*"
}
}
}