# Escaping characters in search

**URL:** <https://discuss.elastic.co/t/escaping-characters-in-search/266955>\
**Category:** Kibana\
**Created:** [March 11, 2021, 1:41pm UTC](https://discuss.elastic.co/t/escaping-characters-in-search/266955 "2021-03-11T13:41:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sam3546](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sam3546/32/79281_2.png) [@sam3546](https://discuss.elastic.co/u/sam3546)\
**Post date:** [March 11, 2021, 1:41pm UTC](https://discuss.elastic.co/t/escaping-characters-in-search/266955/1 "2021-03-11T13:41:35Z")

</div>

So this may be an issue with my mapping or something else.

Im using FSCrawler to crawl a index and put the docs in Elastic, that works fine the issue comes when i try and search on it, im using default FSCrawler and Elastic.

FSCrawler indexes file.url a url of where that file exists such as the example below  
file://Folder1/folder2/folder3/file.ext

When i try to search on that it gives me an error about the : (i assume it thinks it part of the command not the string)

If i put the string in "" like below it works fine, but only for an exact string it wont work with a wildcard

file.url: "file:///Folder1/Folder2/Folder3/file.ext"

Anyone have any suggestions?  
I want to be able to show everything in a sub folder like below.

file.url: file:///Folder1/Folder2/Folder3\*

---

<div class="post-metadata">

**Author:** ![sam3546](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sam3546/32/79281_2.png) [@sam3546](https://discuss.elastic.co/u/sam3546)\
**Post date:** [March 11, 2021, 2:05pm UTC](https://discuss.elastic.co/t/escaping-characters-in-search/266955/2 "2021-03-11T14:05:06Z")

</div>

So i have come to answer my own question again the issue was the : in the path as this is used as a symbol in the query it needs to be escaped, using a \ before the special character will escape it.

If you have a windows file path C:\Folder1\Folder2\Folder3\file.ext you will also need to add a backlash between directories or elastic will try to escape the folder. Below is a correct version

`file.url : C\:\\Folder1\\Folder2\\Folder3\\file.ext`

Not very pretty

---

<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 8, 2021, 2:05pm UTC](https://discuss.elastic.co/t/escaping-characters-in-search/266955/3 "2021-04-08T14:05:41Z")

</div>

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