# Proximity Search with wildcard

**URL:** https://discuss.elastic.co/t/proximity-search-with-wildcard/125907
**Category:** Elasticsearch
**Created:** [March 28, 2018, 10:20am UTC](https://discuss.elastic.co/t/proximity-search-with-wildcard/125907 "2018-03-28T10:20:41Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![kamalgupta0808](https://avatars.discourse-cdn.com/v4/letter/k/e68b1a/32.png) [@kamalgupta0808](https://discuss.elastic.co/u/kamalgupta0808)
#### Post date: [March 28, 2018, 10:20am UTC](https://discuss.elastic.co/t/proximity-search-with-wildcard/125907/1 "2018-03-28T10:20:41Z")

</div>

Hello,  
I am working on a patent doc. Is there a way where Query string Query be used to search in near(proximity) as well as with wildcard? I am not able to use span query because then I have to take care of many cases or can span query be generated by itself.  
For example-

1. ("watch" OR artific\*) near (virtua?)  
Can Query string query be used to fetch the results or any other string Query?
2. Input:  
'ferm! w/5 outil w/5 dispositif'  
Output:  
{  
'span\_near': {  
'clauses': [  
{'span\_multi': {'match': {'prefix': {'text': 'ferm'}}}},  
{'span\_near': {  
'clauses': [  
{'span\_term': {'text': 'outil'}},  
{'span\_term': {'text': 'dispositif'}}  
],  
'collect\_payloads': False,  
'in\_order': False,  
'slop': 4}  
}  
],  
'collect\_payloads': False,  
'in\_order': False,  
'slop': 4  
}  
} },  
I want to this in php or javascript or node.  
Thanks in advance

---

<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: [April 25, 2018, 10:32am UTC](https://discuss.elastic.co/t/proximity-search-with-wildcard/125907/2 "2018-04-25T10:32:31Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
