# How can I use multi\_match and partial keyword

**URL:** <https://discuss.elastic.co/t/how-can-i-use-multi-match-and-partial-keyword/15034>\
**Category:** Elasticsearch\
**Created:** [December 27, 2013, 2:10pm UTC](https://discuss.elastic.co/t/how-can-i-use-multi-match-and-partial-keyword/15034 "2013-12-27T14:10:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nikolay\_Chankov](https://avatars.discourse-cdn.com/v4/letter/n/a8b319/32.png) [@Nikolay\_Chankov](https://discuss.elastic.co/u/Nikolay_Chankov)\
**Post date:** [December 27, 2013, 2:10pm UTC](https://discuss.elastic.co/t/how-can-i-use-multi-match-and-partial-keyword/15034/1 "2013-12-27T14:10:46Z")

</div>

I refined my query to the following:

curl -XGET  
'[http://localhost:9200/venues,events,offers,users/\_search?pretty=true](http://localhost:9200/venues,events,offers,users/_search?pretty=true)' -d '  
{  
"query" : {

```
                "indices" : {
                    "indices" : ["venues", "events", "users", "offers"],
                    "query" : {
                        "multi_match" : {
                            "query" : "Evo*",
                            "fields" : ["name^4", "first_name^4", 

```

"last\_name^4", "town^3.5", "\_all^0.5"]  
}  
}  
}

```
}

```

}'

The problem now is that the \* in the query doesn't take effect. i.e. If I  
use "Evo\*" a node which has name="Evoke" doesn't show in the results,  
while if I search for "Evoke" it show the desired result.

So the question is: How to search for partial term within the field.

Thank you in advance.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/a73bba3e-d91b-4da9-a373-033d6f220f1e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a73bba3e-d91b-4da9-a373-033d6f220f1e%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 27, 2013, 4:10pm UTC](https://discuss.elastic.co/t/how-can-i-use-multi-match-and-partial-keyword/15034/2 "2013-12-27T16:10:40Z")

</div>

Try with evo\* (lowercase).

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 27 décembre 2013 at 15:10:50, Nikolay Chankov ([nchankov@gmail.com](mailto:nchankov@gmail.com)) a écrit:

I refined my query to the following:

curl -XGET '[http://localhost:9200/venues,events,offers,users/\_search?pretty=true](http://localhost:9200/venues,events,offers,users/_search?pretty=true)' -d '  
{  
"query" : {

```
                "indices" : {
                    "indices" : ["venues", "events", "users", "offers"],
                    "query" : {
                        "multi_match" : {
                            "query" : "Evo*",
                            "fields" : ["name^4", "first_name^4", "last_name^4", "town^3.5", "_all^0.5"]
                        }
                    }
                }
            
}

```

}'

The problem now is that the \* in the query doesn't take effect. i.e. If I use "Evo\*" a node which has name="Evoke" doesn't show in the results, while if I search for "Evoke" it show the desired result.

So the question is: How to search for partial term within the field.

Thank you in advance.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/a73bba3e-d91b-4da9-a373-033d6f220f1e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a73bba3e-d91b-4da9-a373-033d6f220f1e%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/etPan.52bda6a6.836c40e.55aa%40MacBook-Air-de-David.local](https://groups.google.com/d/msgid/elasticsearch/etPan.52bda6a6.836c40e.55aa%40MacBook-Air-de-David.local).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Nikolay\_Chankov](https://avatars.discourse-cdn.com/v4/letter/n/a8b319/32.png) [@Nikolay\_Chankov](https://discuss.elastic.co/u/Nikolay_Chankov)\
**Post date:** [December 27, 2013, 4:37pm UTC](https://discuss.elastic.co/t/how-can-i-use-multi-match-and-partial-keyword/15034/3 "2013-12-27T16:37:13Z")

</div>

Thank you for the reply David, but unfortunately it doesn't make any  
difference. ☹

On Friday, December 27, 2013 4:11:18 PM UTC, David Pilato wrote:

> Try with evo\* (lowercase).
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> 
> Le 27 décembre 2013 at 15:10:50, Nikolay Chankov ([ncha...@gmail.com](mailto:ncha...@gmail.com)\<javascript:\>)  
> a écrit:
> 
> I refined my query to the following:
> 
> curl -XGET '  
> [http://localhost:9200/venues,events,offers,users/\_search?pretty=true](http://localhost:9200/venues,events,offers,users/_search?pretty=true)' -d '  
> {  
> "query" : {
> 
> ```
> "indices" : {
> "indices" : ["venues", "events", "users", 
> 
> ```
> 
> "offers"],  
> "query" : {  
> "multi\_match" : {  
> "query" : "Evo\*",  
> "fields" : ["name^4", "first\_name^4",  
> "last\_name^4", "town^3.5", "\_all^0.5"]  
> }  
> }  
> }
> 
> ```
> }
> 
> ```
> 
> }'
> 
> The problem now is that the \* in the query doesn't take effect. i.e. If I  
> use "Evo\*" a node which has name="Evoke" doesn't show in the results,  
> while if I search for "Evoke" it show the desired result.
> 
> So the question is: How to search for partial term within the field.
> 
> Thank you in advance.
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/a73bba3e-d91b-4da9-a373-033d6f220f1e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a73bba3e-d91b-4da9-a373-033d6f220f1e%40googlegroups.com)  
> .  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/b8c7c099-e7b5-412d-89f5-9bf2680bbf50%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b8c7c099-e7b5-412d-89f5-9bf2680bbf50%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 27, 2013, 5:21pm UTC](https://discuss.elastic.co/t/how-can-i-use-multi-match-and-partial-keyword/15034/4 "2013-12-27T17:21:13Z")

</div>

Could you gist a full curl recreation?

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 27 déc. 2013 à 17:37, Nikolay Chankov [nchankov@gmail.com](mailto:nchankov@gmail.com) a écrit :

> Thank you for the reply David, but unfortunately it doesn't make any difference. ☹
> 
> On Friday, December 27, 2013 4:11:18 PM UTC, David Pilato wrote:
> 
> > Try with evo\* (lowercase).
> > 
> > --  
> > David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
> > @dadoonet | @elasticsearchfr
> > 
> > Le 27 décembre 2013 at 15:10:50, Nikolay Chankov ([ncha...@gmail.com](mailto:ncha...@gmail.com)) a écrit:
> > 
> > > I refined my query to the following:
> > > 
> > > curl -XGET '[http://localhost:9200/venues,events,offers,users/\_search?pretty=true](http://localhost:9200/venues,events,offers,users/_search?pretty=true)' -d '  
> > > {  
> > > "query" : {
> > > 
> > > ```
> > > "indices" : {
> > > "indices" : ["venues", "events", "users", "offers"],
> > > "query" : {
> > > "multi_match" : {
> > > "query" : "Evo*",
> > > "fields" : ["name^4", "first_name^4", "last_name^4", "town^3.5", "_all^0.5"]
> > > }
> > > }
> > > }
> > >             
> > > }
> > > 
> > > ```
> > > 
> > > }'
> > > 
> > > The problem now is that the \* in the query doesn't take effect. i.e. If I use "Evo\*" a node which has name="Evoke" doesn't show in the results, while if I search for "Evoke" it show the desired result.
> > > 
> > > So the question is: How to search for partial term within the field.
> > > 
> > > Thank you in advance.
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/a73bba3e-d91b-4da9-a373-033d6f220f1e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a73bba3e-d91b-4da9-a373-033d6f220f1e%40googlegroups.com).  
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/b8c7c099-e7b5-412d-89f5-9bf2680bbf50%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b8c7c099-e7b5-412d-89f5-9bf2680bbf50%40googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/F252B773-49AD-47A8-95FC-31B0C8CA3871%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/F252B773-49AD-47A8-95FC-31B0C8CA3871%40pilato.fr).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Nikolay\_Chankov](https://avatars.discourse-cdn.com/v4/letter/n/a8b319/32.png) [@Nikolay\_Chankov](https://discuss.elastic.co/u/Nikolay_Chankov)\
**Post date:** [December 27, 2013, 5:59pm UTC](https://discuss.elastic.co/t/how-can-i-use-multi-match-and-partial-keyword/15034/5 "2013-12-27T17:59:52Z")

</div>

The indexes are populated from jdbc river, so I will try to create an  
example. The behavior is the same. HTH

Here it is:  
curl -XDELETE '[http://localhost:9200/test\_venues](http://localhost:9200/test_venues)'  
curl -XPUT '[http://localhost:9200/test\_venues](http://localhost:9200/test_venues)'  
curl -XPUT '[http://localhost:9200/test\_venues/test\_venue/\_mapping](http://localhost:9200/test_venues/test_venue/_mapping)' -d '  
{  
"test\_venue" : {  
"properties" : {  
"object" : { "type" : "string" },  
"id" : { "type" : "integer" },  
"name" : { "type" : "string" }  
}  
}  
}'  
curl -XPUT '[http://localhost:9200/test\_venues/test\_venue/1](http://localhost:9200/test_venues/test_venue/1)' -d '{  
"object" : "Venue",  
"id" : 1,  
"name" : "Evoke"  
}'  
curl -XPUT '[http://localhost:9200/test\_venues/test\_venue/2](http://localhost:9200/test_venues/test_venue/2)' -d '{  
"object" : "Venue",  
"id" : 1,  
"name" : "Evo"  
}'

curl -XGET '[http://localhost:9200/test\_venues/\_search?pretty=true](http://localhost:9200/test_venues/_search?pretty=true)' -d '  
{  
"query" : {  
"indices" : {  
"indices" : ["test\_venues"],  
"query" : {  
"multi\_match" : {  
"query" : "evo\*",  
"fields" : ["name^4", "\_all^1"]  
}  
}  
}  
}  
}'

On Friday, December 27, 2013 5:21:13 PM UTC, David Pilato wrote:

> Could you gist a full curl recreation?
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 27 déc. 2013 à 17:37, Nikolay Chankov \<[ncha...@gmail.com](mailto:ncha...@gmail.com) \<javascript:\>\>  
> a écrit :
> 
> Thank you for the reply David, but unfortunately it doesn't make any  
> difference. ☹
> 
> On Friday, December 27, 2013 4:11:18 PM UTC, David Pilato wrote:
> 
> > Try with evo\* (lowercase).
> > 
> > --  
> > _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)  
> > [http://Elasticsearch.com](http://Elasticsearch.com)_  
> > @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> > 
> > Le 27 décembre 2013 at 15:10:50, Nikolay Chankov ([ncha...@gmail.com](mailto:ncha...@gmail.com)) a  
> > écrit:
> > 
> > I refined my query to the following:
> > 
> > curl -XGET '  
> > [http://localhost:9200/venues,events,offers,users/\_search?pretty=true](http://localhost:9200/venues,events,offers,users/_search?pretty=true)' -d  
> > '  
> > {  
> > "query" : {
> > 
> > ```
> > "indices" : {
> > "indices" : ["venues", "events", "users", 
> > 
> > ```
> > 
> > "offers"],  
> > "query" : {  
> > "multi\_match" : {  
> > "query" : "Evo\*",  
> > "fields" : ["name^4", "first\_name^4",  
> > "last\_name^4", "town^3.5", "\_all^0.5"]  
> > }  
> > }  
> > }
> > 
> > ```
> > }
> > 
> > ```
> > 
> > }'
> > 
> > The problem now is that the \* in the query doesn't take effect. i.e. If I  
> > use "Evo\*" a node which has name="Evoke" doesn't show in the results,  
> > while if I search for "Evoke" it show the desired result.
> > 
> > So the question is: How to search for partial term within the field.
> > 
> > Thank you in advance.
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/a73bba3e-d91b-4da9-a373-033d6f220f1e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a73bba3e-d91b-4da9-a373-033d6f220f1e%40googlegroups.com)  
> > .  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/b8c7c099-e7b5-412d-89f5-9bf2680bbf50%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b8c7c099-e7b5-412d-89f5-9bf2680bbf50%40googlegroups.com)  
> > .  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/cd8c5f63-9b28-4f58-9eba-579c3ef27173%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/cd8c5f63-9b28-4f58-9eba-579c3ef27173%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 28, 2013, 9:21am UTC](https://discuss.elastic.co/t/how-can-i-use-multi-match-and-partial-keyword/15034/6 "2013-12-28T09:21:55Z")

</div>

match query and multi match query does not support wildcards.  
That said, it's often a bad practice in elasticsearch using wildcards queries because they are slow.

You should may be change your mapping and use ngrams or edge ngrams for your field.

And just query this field with "evo" without any wildcard.

HTH

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 27 décembre 2013 at 18:59:55, Nikolay Chankov ([nchankov@gmail.com](mailto:nchankov@gmail.com)) a écrit:

curl -XDELETE '[http://localhost:9200/test\_venues](http://localhost:9200/test_venues)'  
curl -XPUT '[http://localhost:9200/test\_venues](http://localhost:9200/test_venues)'  
curl -XPUT '[http://localhost:9200/test\_venues/test\_venue/\_mapping](http://localhost:9200/test_venues/test_venue/_mapping)' -d '  
{  
"test\_venue" : {  
"properties" : {  
"object" : { "type" : "string" },  
"id" : { "type" : "integer" },  
"name" : { "type" : "string" }  
}  
}  
}'  
curl -XPUT '[http://localhost:9200/test\_venues/test\_venue/1](http://localhost:9200/test_venues/test_venue/1)' -d '{  
"object" : "Venue",  
"id" : 1,  
"name" : "Evoke"  
}'  
curl -XPUT '[http://localhost:9200/test\_venues/test\_venue/2](http://localhost:9200/test_venues/test_venue/2)' -d '{  
"object" : "Venue",  
"id" : 1,  
"name" : "Evo"  
}'

curl -XGET '[http://localhost:9200/test\_venues/\_search?pretty=true](http://localhost:9200/test_venues/_search?pretty=true)' -d '  
{  
"query" : {  
"indices" : {  
"indices" : ["test\_venues"],  
"query" : {  
"multi\_match" : {  
"query" : "evo\*",  
"fields" : ["name^4", "\_all^1"]  
}  
}  
}  
}  
}'

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/etPan.52be985d.419ac241.55aa%40MacBook-Air-de-David.local](https://groups.google.com/d/msgid/elasticsearch/etPan.52be985d.419ac241.55aa%40MacBook-Air-de-David.local).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 1:59am UTC](https://discuss.elastic.co/t/how-can-i-use-multi-match-and-partial-keyword/15034/7 "2017-07-06T01:59:11Z")

</div>


