# Can one do a proximity search with root expanders and phrases?

**URL:** <https://discuss.elastic.co/t/can-one-do-a-proximity-search-with-root-expanders-and-phrases/11490>\
**Category:** Elasticsearch\
**Created:** [April 8, 2013, 6:11pm UTC](https://discuss.elastic.co/t/can-one-do-a-proximity-search-with-root-expanders-and-phrases/11490 "2013-04-08T18:11:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jacob\_Heller](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@Jacob\_Heller](https://discuss.elastic.co/u/Jacob_Heller)\
**Post date:** [April 8, 2013, 6:11pm UTC](https://discuss.elastic.co/t/can-one-do-a-proximity-search-with-root-expanders-and-phrases/11490/1 "2013-04-08T18:11:05Z")

</div>

Hi all,

I'm just starting out on a new project, and I'm trying to decide whether  
we'll use ElasticSearch for the first time or not. (I really want to!)

One problem is that my users (legal professionals) demand very specific  
types of search queries. One type is the ability to do very particular  
types of proximity searches (i.e., phrase A is within n words of phrase B)  
and to have root expanders .

Imagine a document that contained the following sentence:  
"The Fourth Amendment damages were mitigated because the police officers  
conducted the warrantless search when no one was home."

A user may search for:

- mitig\* (mitigated, mitigate, mitigates, etc...)
- within 5 words of the phrase "Fourth Amendment damages"
- and all that within 20 words of "warrant\* search" ("warrantless  
search", "warranted search", "warrant search", etc.).

This probably isn't valid syntax, but something like:  
((mitig\* "Fourth Amendment damages")~5 "warrant\* search")~20

For what it's worth, in at least one other search engine (that I'm trying  
to avoid), dtSearch, the syntax would be:  
(mitig\* w/5 "Fourth Amendment damages") w/20 "warrant\* search"

Looking forward to hearing if this is possible and hopefully joining the ES  
community!

Jake

--  
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:42am UTC](https://discuss.elastic.co/t/can-one-do-a-proximity-search-with-root-expanders-and-phrases/11490/2 "2017-07-06T02:42:12Z")

</div>

Closed on July 6, 2017, 2:42am UTC


