# Elasticsearch setting a start node

**URL:** <https://discuss.elastic.co/t/elasticsearch-setting-a-start-node/96230>\
**Category:** Elasticsearch\
**Created:** [August 8, 2017, 9:41am UTC](https://discuss.elastic.co/t/elasticsearch-setting-a-start-node/96230 "2017-08-08T09:41:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bilpor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bilpor/32/24043_2.png) [@bilpor](https://discuss.elastic.co/u/bilpor)\
**Post date:** [August 8, 2017, 9:41am UTC](https://discuss.elastic.co/t/elasticsearch-setting-a-start-node/96230/1 "2017-08-08T09:41:59Z")

</div>

HI All,

I have a directory structure:  
w:\docs  
w:\docs\set1  
w:\docs\set2 etc.

In my config W:\docs is set as my root directory for elasticsearch. For most searches starting here is fine, but On some searches I know that the documents I'm looking for will be in set1 for instance. What do I need to set to tell Elasticsearch to limit the search to set1? I'm using Elasticsearch 5.5.1

I thought it might be something like:

`GET myindex/_search?q=content:Dave AND (hits.hits._source.path.real=:w//Docs//set1//*)&sort=hits.hits._source.file.last_modified:desc:size=10`

but it still returns all docs with content 'Dave' regardless of location

but if I have files with 'dave' in the root or set2 they still get returned

OR using the style :  
`GET myindex/_search { "query": { "wildcard" : { "path.real" : "W:\\\\Docs\\\\set1\\\\*" } }`

will return only the documents in this directory, but I cant seem to combine it with content.

---

<div class="post-metadata">

**Author:** ![bilpor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bilpor/32/24043_2.png) [@bilpor](https://discuss.elastic.co/u/bilpor)\
**Post date:** [August 10, 2017, 1:12pm UTC](https://discuss.elastic.co/t/elasticsearch-setting-a-start-node/96230/2 "2017-08-10T13:12:36Z")

</div>

The solution is:

`GET myindex/_search?q=content:Dav AND (path.real=:"""w:\\Docs\\set1\\*""")`

---

<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:** [September 7, 2017, 1:13pm UTC](https://discuss.elastic.co/t/elasticsearch-setting-a-start-node/96230/3 "2017-09-07T13:13:20Z")

</div>

Closed on September 7, 2017, 1:13pm UTC

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