# How to create a setup for searching for people

**URL:** <https://discuss.elastic.co/t/how-to-create-a-setup-for-searching-for-people/64562>\
**Category:** Elasticsearch\
**Created:** [November 1, 2016, 1:54pm UTC](https://discuss.elastic.co/t/how-to-create-a-setup-for-searching-for-people/64562 "2016-11-01T13:54:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![leskedrikk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leskedrikk/32/12873_2.png) [@leskedrikk](https://discuss.elastic.co/u/leskedrikk)\
**Post date:** [November 1, 2016, 1:54pm UTC](https://discuss.elastic.co/t/how-to-create-a-setup-for-searching-for-people/64562/1 "2016-11-01T13:54:42Z")

</div>

We have a list of 80K names, only fullnames so no split between first name and last name.

We have indexed the names with multiple inputs and one output like:  
"John Stones" has inputs of

1. "John Stones"
2. "Stones"  
And output of  
"John Stones".

But when we do a search for "John S" we get hits with better score like:  
"John Keister"

I think we are missing something fundamental here so any guidance would be really appreciated as we're new to Elasticsearch. How should we setup the search so it gets us better results where John Stones has a higher score than "John Keister" when searching for "John S"?

---

<div class="post-metadata">

**Author:** ![cbuescher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cbuescher/32/60402_2.png) [@cbuescher](https://discuss.elastic.co/u/cbuescher)\
**Post date:** [November 1, 2016, 2:03pm UTC](https://discuss.elastic.co/t/how-to-create-a-setup-for-searching-for-people/64562/2 "2016-11-01T14:03:54Z")

</div>

Hi,

some more information about your document structure, your mappings (have you defined any) and the queries you are trying out would be of help here. Generally speaking, for your use case, [Prefix Query](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/query-dsl-prefix-query.html) would be something to worth looking at, but maybe there are variations that are more performant.

---

<div class="post-metadata">

**Author:** ![leskedrikk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leskedrikk/32/12873_2.png) [@leskedrikk](https://discuss.elastic.co/u/leskedrikk)\
**Post date:** [November 2, 2016, 12:18pm UTC](https://discuss.elastic.co/t/how-to-create-a-setup-for-searching-for-people/64562/3 "2016-11-02T12:18:00Z")

</div>

Thanks! Prefix Query seems like it is what we are after. We'll have a go at that!

We are using .NET and using the automapper so nothing very special set in terms of mapping.

---

<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 5, 2017, 10:07pm UTC](https://discuss.elastic.co/t/how-to-create-a-setup-for-searching-for-people/64562/4 "2017-07-05T22:07:26Z")

</div>


