# "double barreled" surname search fails

**URL:** <https://discuss.elastic.co/t/double-barreled-surname-search-fails/14971>\
**Category:** Elasticsearch\
**Created:** [December 20, 2013, 9:15am UTC](https://discuss.elastic.co/t/double-barreled-surname-search-fails/14971 "2013-12-20T09:15:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark\_Perry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_perry/32/1903_2.png) [@Mark\_Perry](https://discuss.elastic.co/u/Mark_Perry)\
**Post date:** [December 20, 2013, 9:15am UTC](https://discuss.elastic.co/t/double-barreled-surname-search-fails/14971/1 "2013-12-20T09:15:45Z")

</div>

Can anyone tell me why this search works:

{"query":{"bool":{"must":[{"term":{"chosenforename":"brian"}},{"term":{"surname":"jones"}},{"term":{"dob":"2002-02-12T00:00:00"}},{"range":{"eventstart":{"from":"2013-09-01T00:00:00","to":"2013-11-14T00:00:00"}}}]}}}

but this one doesn't:

{"query":{"bool":{"must":[{"term":{"chosenforename":"brian"}},{"term":{"surname":"jones-walker"}},{"term":{"dob":"2002-02-12T00:00:00"}},{"range":{"eventstart":{"from":"2013-09-01T00:00:00","to":"2013-11-14T00:00:00"}}}]}}}

i.e. second search has a "double barreled" surname in it?

--  
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/a04c9815-ce66-4357-a3e1-ef1e4b288c4c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a04c9815-ce66-4357-a3e1-ef1e4b288c4c%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:** ![paul1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paul1/32/46819_2.png) [@paul1](https://discuss.elastic.co/u/paul1)\
**Post date:** [December 20, 2013, 9:36am UTC](https://discuss.elastic.co/t/double-barreled-surname-search-fails/14971/2 "2013-12-20T09:36:07Z")

</div>

It depends on your mapping , can you show the mapping for your surname.

Reagrds  
Avinash

On Friday, 20 December 2013 14:45:45 UTC+5:30, Mark Perry wrote:

> Can anyone tell me why this search works:
> 
> {"query":{"bool":{"must":[{"term":{"chosenforename":"brian"}},{"term":{"surname":"jones"}},{"term":{"dob":"2002-02-12T00:00:00"}},{"range":{"eventstart":{"from":"2013-09-01T00:00:00","to":"2013-11-14T00:00:00"}}}]}}}
> 
> but this one doesn't:
> 
> {"query":{"bool":{"must":[{"term":{"chosenforename":"brian"}},{"term":{"surname":"jones-walker"}},{"term":{"dob":"2002-02-12T00:00:00"}},{"range":{"eventstart":{"from":"2013-09-01T00:00:00","to":"2013-11-14T00:00:00"}}}]}}}
> 
> i.e. second search has a "double barreled" surname in it?

--  
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/3f42fff1-faca-4aa1-be51-3704571b3112%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3f42fff1-faca-4aa1-be51-3704571b3112%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:** ![Mark\_Perry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_perry/32/1903_2.png) [@Mark\_Perry](https://discuss.elastic.co/u/Mark_Perry)\
**Post date:** [December 20, 2013, 10:58am UTC](https://discuss.elastic.co/t/double-barreled-surname-search-fails/14971/3 "2013-12-20T10:58:35Z")

</div>

All the data is going through the bulk uploader. In C# I serialize the  
object that represents the individual and add it to a string that will be  
passed to a PUT request. I don't think I have a specific mapping - can you  
recommend something I need to read up on?

sb.Append("{ "create" : {"\_index" : "knowsleycitizen", "\_type" :  
"attendance", "\_id" : "" + id.ToString() + ""} }\n" +  
Newtonsoft.Json.JsonConvert.SerializeObject(b) + "\n");

On Friday, 20 December 2013 09:36:07 UTC, paul wrote:

> It depends on your mapping , can you show the mapping for your surname.
> 
> Reagrds  
> Avinash
> 
> On Friday, 20 December 2013 14:45:45 UTC+5:30, Mark Perry wrote:
> 
> > Can anyone tell me why this search works:
> > 
> > {"query":{"bool":{"must":[{"term":{"chosenforename":"brian"}},{"term":{"surname":"jones"}},{"term":{"dob":"2002-02-12T00:00:00"}},{"range":{"eventstart":{"from":"2013-09-01T00:00:00","to":"2013-11-14T00:00:00"}}}]}}}
> > 
> > but this one doesn't:
> > 
> > {"query":{"bool":{"must":[{"term":{"chosenforename":"brian"}},{"term":{"surname":"jones-walker"}},{"term":{"dob":"2002-02-12T00:00:00"}},{"range":{"eventstart":{"from":"2013-09-01T00:00:00","to":"2013-11-14T00:00:00"}}}]}}}
> > 
> > i.e. second search has a "double barreled" surname in it?

--  
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/2278cdea-4952-49d5-a8f4-c604acfd870c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2278cdea-4952-49d5-a8f4-c604acfd870c%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:** ![paul1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paul1/32/46819_2.png) [@paul1](https://discuss.elastic.co/u/paul1)\
**Post date:** [December 20, 2013, 11:22am UTC](https://discuss.elastic.co/t/double-barreled-surname-search-fails/14971/4 "2013-12-20T11:22:37Z")

</div>

On Friday, 20 December 2013 14:45:45 UTC+5:30, Mark Perry wrote:

> Can anyone tell me why this search works:
> 
> {"query":{"bool":{"must":[{"term":{"chosenforename":"brian"}},{"term":{"surname":"jones"}},{"term":{"dob":"2002-02-12T00:00:00"}},{"range":{"eventstart":{"from":"2013-09-01T00:00:00","to":"2013-11-14T00:00:00"}}}]}}}
> 
> but this one doesn't:
> 
> {"query":{"bool":{"must":[{"term":{"chosenforename":"brian"}},{"term":{"surname":"jones-walker"}},{"term":{"dob":"2002-02-12T00:00:00"}},{"range":{"eventstart":{"from":"2013-09-01T00:00:00","to":"2013-11-14T00:00:00"}}}]}}}
> 
> i.e. second search has a "double barreled" surname in it?

--  
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/70d89699-861b-4495-8431-d3dbd4690e2f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/70d89699-861b-4495-8431-d3dbd4690e2f%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:** ![paul1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paul1/32/46819_2.png) [@paul1](https://discuss.elastic.co/u/paul1)\
**Post date:** [December 20, 2013, 11:27am UTC](https://discuss.elastic.co/t/double-barreled-surname-search-fails/14971/5 "2013-12-20T11:27:13Z")

</div>

By default Strings are analyzed using "standard analyzer"  
[http://localhost:9200/](http://localhost:9200/)/\_analyze?analyzer=standard&text=jones-walker&pretty[http://localhost:9200/sports/\_analyze?analyzer=standard&text=jones-walker&pretty](http://localhost:9200/sports/_analyze?analyzer=standard&text=jones-walker&pretty)

{ "tokens" : [ { "token" : "jones", "start\_offset" : 0, "end\_offset" : 5, "type"  
: "", "position" : 1 }, { "token" : "walker", "start\_offset" : 6, "end\_offset"  
: 12, "type" : "", "position" : 2 } ] }

So the terms stored after analysis are as aboveRead standard analyzer

On Friday, 20 December 2013 16:28:35 UTC+5:30, Mark Perry wrote:

> All the data is going through the bulk uploader. In C# I serialize the  
> object that represents the individual and add it to a string that will be  
> passed to a PUT request. I don't think I have a specific mapping - can you  
> recommend something I need to read up on?
> 
> sb.Append("{ "create" : {"\_index" : "knowsleycitizen", "\_type" :  
> "attendance", "\_id" : "" + id.ToString() + ""} }\n" +  
> Newtonsoft.Json.JsonConvert.SerializeObject(b) + "\n");
> 
> On Friday, 20 December 2013 09:36:07 UTC, paul wrote:
> 
> > It depends on your mapping , can you show the mapping for your surname.
> > 
> > Reagrds  
> > Avinash
> > 
> > On Friday, 20 December 2013 14:45:45 UTC+5:30, Mark Perry wrote:
> > 
> > > Can anyone tell me why this search works:
> > > 
> > > {"query":{"bool":{"must":[{"term":{"chosenforename":"brian"}},{"term":{"surname":"jones"}},{"term":{"dob":"2002-02-12T00:00:00"}},{"range":{"eventstart":{"from":"2013-09-01T00:00:00","to":"2013-11-14T00:00:00"}}}]}}}
> > > 
> > > but this one doesn't:
> > > 
> > > {"query":{"bool":{"must":[{"term":{"chosenforename":"brian"}},{"term":{"surname":"jones-walker"}},{"term":{"dob":"2002-02-12T00:00:00"}},{"range":{"eventstart":{"from":"2013-09-01T00:00:00","to":"2013-11-14T00:00:00"}}}]}}}
> > > 
> > > i.e. second search has a "double barreled" surname in it?

--  
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/d972987f-9e6c-46fa-8dc6-301d2e8a583f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d972987f-9e6c-46fa-8dc6-301d2e8a583f%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:59am UTC](https://discuss.elastic.co/t/double-barreled-surname-search-fails/14971/6 "2017-07-06T01:59:58Z")

</div>


