# Trying to build a faceted search that works like a charm, except for my locations\_path

**URL:** <https://discuss.elastic.co/t/trying-to-build-a-faceted-search-that-works-like-a-charm-except-for-my-locations-path/15592>\
**Category:** Elasticsearch\
**Created:** [February 4, 2014, 4:04pm UTC](https://discuss.elastic.co/t/trying-to-build-a-faceted-search-that-works-like-a-charm-except-for-my-locations-path/15592 "2014-02-04T16:04:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![georgi\_mateev](https://avatars.discourse-cdn.com/v4/letter/g/a6a055/32.png) [@georgi\_mateev](https://discuss.elastic.co/u/georgi_mateev)\
**Post date:** [February 4, 2014, 4:04pm UTC](https://discuss.elastic.co/t/trying-to-build-a-faceted-search-that-works-like-a-charm-except-for-my-locations-path/15592/1 "2014-02-04T16:04:30Z")

</div>

Hi guys,  
I have been trying to build a faceted search and it works pretty well so  
far. There is just one problem that I have been struggling with in the last  
few days.

It is a multinational jobsearch and the jobs are categorized under a  
country and a state. I want to be able to search for different states in  
different countries (It could happen in the EU, where some people would be  
interested to work abroad in a neighboring district).

So what I tried out was this tutorial  
[http://www.springyweb.com/2012/01/hierarchical-faceting-with-elastic.html](http://www.springyweb.com/2012/01/hierarchical-faceting-with-elastic.html) .  
I skipped the part with the new tokenizer, as I don't care about the number  
of the level.

Unfortunately it didn't work. The fields seems to get tokenized, since when  
I search for regexp "44" it finds /44/10, if I search for "10" it finds  
/44/10, but if I search for "/44" or "44.\*" I get 0 hits.

Then I removed the path\_tokenizer and tried to work with a not\_analyzed  
string, hoping that it would do the job, but again it didn't work out.

What am I doing wrong? This is the mapping: The field is locations\_path

> <https://gist.github.com/anonymous/8805721>

{  
"vacancy": {  
"index\_analyzer": "indexAnalyzer",  
"search\_analyzer": "searchAnalyzer",  
"\_boost": {  
"name": "\_boost",  
"null\_value": 1  
},  
"properties": {  
"vId": {  
"type": "integer",  
"include\_in\_all": false  
},  
"title": {  
"type": "string",  
"include\_in\_all": true  
},  
"teaser": {  
"type": "string",  
"include\_in\_all": true  
},  
"keywords": {  
"type": "multi\_field",  
"include\_in\_all": true  
},  
"completion": {  
"type": "completion",  
"analyzer": "standard"  
},  
"description": {  
"type": "string",  
"include\_in\_all": true  
},  
"company": {  
"type": "multi\_field",  
"include\_in\_all": true  
},  
"company\_id": {  
"type": "multi\_field",  
"include\_in\_all": false  
},  
"workingSchedule": {  
"type": "object",  
"properties": {  
"de": {  
"type": "string",  
"include\_in\_all": true  
},  
"ch": {  
"type": "string",  
"include\_in\_all": true  
},  
"pl": {  
"type": "string",  
"include\_in\_all": true  
}  
}  
},  
"careerPosition": {  
"type": "object",  
"properties": {  
"de": {  
"type": "string",  
"include\_in\_all": true  
},  
"ch": {  
"type": "string",  
"include\_in\_all": true  
},  
"pl": {  
"type": "string",  
"include\_in\_all": true  
}  
}  
},  
"jobExperience": {  
"type": "object",  
"properties": {  
"de": {  
"type": "string",  
"include\_in\_all": true  
},  
"ch": {  
"type": "string",  
"include\_in\_all": true  
},  
"pl": {  
"type": "string",  
"include\_in\_all": true  
}  
}  
},  
"seniority": {  
"type": "object",  
"properties": {  
"de": {  
"type": "string",  
"include\_in\_all": true  
},  
"ch": {  
"type": "string",  
"include\_in\_all": true  
},  
"pl": {  
"type": "string",  
"include\_in\_all": true  
}  
}  
},  
"subjects": {  
"type": "multi\_field",  
"include\_in\_all": false  
},  
"subjects\_fulltext": {  
"type": "object",  
"properties": {  
"de": {  
"type": "multi\_field",  
"include\_in\_all": true  
},  
"ch": {  
"type": "multi\_field",  
"include\_in\_all": true  
},  
"pl": {  
"type": "multi\_field",  
"include\_in\_all": true  
}  
}  
},  
"locations\_path": {  
"type": "string",  
"include\_in\_all": false,  
"index": "not\_analyzed"  
},  
"locations": {  
"type": "multi\_field",  
"include\_in\_all": false  
},  
"locations\_fulltext": {  
"type": "multi\_field",  
"include\_in\_all": true  
},  
"categories": {  
"type": "multi\_field",  
"include\_in\_all": false  
},  
"categories\_fulltext": {  
"type": "object",  
"properties": {  
"de": {  
"type": "multi\_field",  
"include\_in\_all": true  
},  
"ch": {  
"type": "multi\_field",  
"include\_in\_all": true  
},  
"pl": {  
"type": "multi\_field",  
"include\_in\_all": true  
}  
}  
},  
"careerPosition\_id": {  
"type": "multi\_field",  
"include\_in\_all": false  
},  
"workingSchedule\_id": {  
"type": "multi\_field",  
"include\_in\_all": false  
},  
"jobExperience\_id": {  
"type": "multi\_field",  
"include\_in\_all": false  
},  
"seniority\_id": {  
"type": "multi\_field",  
"include\_in\_all": false  
}  
}  
}  
}

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/bf626da9-3ff8-4f1e-9977-f29ba54429df%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bf626da9-3ff8-4f1e-9977-f29ba54429df%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![georgi\_mateev](https://avatars.discourse-cdn.com/v4/letter/g/a6a055/32.png) [@georgi\_mateev](https://discuss.elastic.co/u/georgi_mateev)\
**Post date:** [February 4, 2014, 4:18pm UTC](https://discuss.elastic.co/t/trying-to-build-a-faceted-search-that-works-like-a-charm-except-for-my-locations-path/15592/2 "2014-02-04T16:18:00Z")

</div>

Another strange thing that I see, is that if the field is mapped like a  
"string", I am not able to find anything on it. Neither can I do facets. If  
it is a multi\_field, I get facets and results.

That's something that the documentation didn't say, that's why I think that  
I have other errors in the setup. But the documentation doesn't say  
anything on that topic as well, so I don't know what it is.

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/a736eb64-b513-496f-a892-7d3938f74bb9%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a736eb64-b513-496f-a892-7d3938f74bb9%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![georgi\_mateev](https://avatars.discourse-cdn.com/v4/letter/g/a6a055/32.png) [@georgi\_mateev](https://discuss.elastic.co/u/georgi_mateev)\
**Post date:** [February 4, 2014, 5:49pm UTC](https://discuss.elastic.co/t/trying-to-build-a-faceted-search-that-works-like-a-charm-except-for-my-locations-path/15592/3 "2014-02-04T17:49:01Z")

</div>

There is a complete curl recreation in this gist:

[https://gist.github.com/gmateev/8808650](https://gist.github.com/gmateev/8808650)

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/3d2c57fd-6b15-480e-bdbc-8ef210c564dc%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3d2c57fd-6b15-480e-bdbc-8ef210c564dc%40googlegroups.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, 1:52am UTC](https://discuss.elastic.co/t/trying-to-build-a-faceted-search-that-works-like-a-charm-except-for-my-locations-path/15592/4 "2017-07-06T01:52:39Z")

</div>


