# SpanMultiTermQuery with wildcards

**URL:** <https://discuss.elastic.co/t/spanmultitermquery-with-wildcards/13812>\
**Category:** Elasticsearch\
**Created:** [October 1, 2013, 6:29am UTC](https://discuss.elastic.co/t/spanmultitermquery-with-wildcards/13812 "2013-10-01T06:29:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![michal\_samek](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@michal\_samek](https://discuss.elastic.co/u/michal_samek)\
**Post date:** [October 1, 2013, 6:29am UTC](https://discuss.elastic.co/t/spanmultitermquery-with-wildcards/13812/1 "2013-10-01T06:29:31Z")

</div>

Hi everybody,

forgive me my lame question, but how can I combine more wildcard queries in  
SpanMultiTermQuery? I have tried

{  
"query": {  
"span\_multi": {  
"match": [  
{  
"wildcard": {  
"message": {  
"value": "elastic\*"  
}  
}  
},  
{  
"wildcard": {  
"message": {  
"value": "rock\*"  
}  
}  
}  
]  
}  
}  
}

but this doesn't work :-/

Thanks!

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [October 1, 2013, 10:57pm UTC](https://discuss.elastic.co/t/spanmultitermquery-with-wildcards/13812/2 "2013-10-01T22:57:31Z")

</div>

Span query terms are not analyzed, so you cannot use wildcards. Try using  
the prefix option or switching to match phrase queries.

Cheers,

Ivan

On Mon, Sep 30, 2013 at 11:29 PM, michal samek [samek.michal@gmail.com](mailto:samek.michal@gmail.com)wrote:

> Hi everybody,
> 
> forgive me my lame question, but how can I combine more wildcard queries  
> in SpanMultiTermQuery? I have tried
> 
> {  
> "query": {  
> "span\_multi": {  
> "match": [  
> {  
> "wildcard": {  
> "message": {  
> "value": "elastic\*"  
> }  
> }  
> },  
> {  
> "wildcard": {  
> "message": {  
> "value": "rock\*"  
> }  
> }  
> }  
> ]  
> }  
> }  
> }
> 
> but this doesn't work :-/
> 
> Thanks!
> 
> --  
> 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).  
> 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).  
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, 2:14am UTC](https://discuss.elastic.co/t/spanmultitermquery-with-wildcards/13812/3 "2017-07-06T02:14:04Z")

</div>


