# Is it possible for query results to include the time/geo bounds of the returned documents

**URL:** <https://discuss.elastic.co/t/is-it-possible-for-query-results-to-include-the-time-geo-bounds-of-the-returned-documents/11949>\
**Category:** Elasticsearch\
**Created:** [May 14, 2013, 8:21am UTC](https://discuss.elastic.co/t/is-it-possible-for-query-results-to-include-the-time-geo-bounds-of-the-returned-documents/11949 "2013-05-14T08:21:14Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ian\_mayo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ian_mayo/32/2324_2.png) [@ian\_mayo](https://discuss.elastic.co/u/ian_mayo)\
**Post date:** [May 14, 2013, 8:21am UTC](https://discuss.elastic.co/t/is-it-possible-for-query-results-to-include-the-time-geo-bounds-of-the-returned-documents/11949/1 "2013-05-14T08:21:14Z")

</div>

I've got a faceted search page that's working really well, supported by  
ElasticSearch.

Many of my documents have start/end, plus geo-bounds attributes.

So, in addition to returning the matching documents, plus a list of facet  
scores, I'd like ES to return the temporal and spatial bounds of the  
matching documents.

i.e. a plain-english translation of the actual search returns would be "12  
property rentals with free wifi are available for under $100 per week"

I wish to extend the returned info to received: "12 property rentals with  
free wifi are available for under $100 per week, _the available dates range  
from 1st June to 12th July and they're located from 12.1N, 3.2E to 15.2N,  
5.5E_"

I can't find the terms to use in the API guide for this, but I don't really  
know what I'm looking for.

Any tips would be most welcome.  
Cheers,  
Ian

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 14, 2013, 8:36am UTC](https://discuss.elastic.co/t/is-it-possible-for-query-results-to-include-the-time-geo-bounds-of-the-returned-documents/11949/2 "2013-05-14T08:36:40Z")

</div>

May be script fields? [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/script-fields/)

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 14 mai 2013 à 10:21, ian mayo [ian@planetmayo.com](mailto:ian@planetmayo.com) a écrit :

> I've got a faceted search page that's working really well, supported by Elasticsearch.
> 
> Many of my documents have start/end, plus geo-bounds attributes.
> 
> So, in addition to returning the matching documents, plus a list of facet scores, I'd like ES to return the temporal and spatial bounds of the matching documents.
> 
> i.e. a plain-english translation of the actual search returns would be "12 property rentals with free wifi are available for under $100 per week"
> 
> I wish to extend the returned info to received: "12 property rentals with free wifi are available for under $100 per week, the available dates range from 1st June to 12th July and they're located from 12.1N, 3.2E to 15.2N, 5.5E"
> 
> I can't find the terms to use in the API guide for this, but I don't really know what I'm looking for.
> 
> Any tips would be most welcome.  
> Cheers,  
> Ian
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![ian\_mayo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ian_mayo/32/2324_2.png) [@ian\_mayo](https://discuss.elastic.co/u/ian_mayo)\
**Post date:** [May 14, 2013, 12:34pm UTC](https://discuss.elastic.co/t/is-it-possible-for-query-results-to-include-the-time-geo-bounds-of-the-returned-documents/11949/3 "2013-05-14T12:34:47Z")

</div>

thanks for the prompt reply David,  
the scripts capability would appear to just allow me to return the  
individual temporal/spatial bounds for each document - but I'm already  
getting these in my search returns 😉

I guess that in the NoSQL context the scripts would give me my Map  
function, but I still need a Reduce function to give me the overall range.

This seems similar to the facets query parameter: for the requested facets,  
this gives me a count of how many documents match that facet. I'm hoping  
for a similar capability that tells me the time-period, geo-bounds for the  
overall set of returns.

Cheers,  
Ian

On Tuesday, 14 May 2013 09:38:22 UTC+1, David Pilato wrote:

> May be script fields?  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/script-fields/)
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)  
> | @scrutmydocs [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> 
> Le 14 mai 2013 à 10:21, ian mayo \<[i...@planetmayo.com](mailto:i...@planetmayo.com) \<javascript:\>\> a  
> écrit :
> 
> I've got a faceted search page that's working really well, supported by  
> Elasticsearch.
> 
> Many of my documents have start/end, plus geo-bounds attributes.
> 
> So, in addition to returning the matching documents, plus a list of facet  
> scores, I'd like ES to return the temporal and spatial bounds of the  
> matching documents.
> 
> i.e. a plain-english translation of the actual search returns would be "12  
> property rentals with free wifi are available for under $100 per week"
> 
> I wish to extend the returned info to received: "12 property rentals with  
> free wifi are available for under $100 per week, _the available dates  
> range from 1st June to 12th July and they're located from 12.1N, 3.2E to  
> 15.2N, 5.5E_"
> 
> I can't find the terms to use in the API guide for this, but I don't  
> really know what I'm looking for.
> 
> Any tips would be most welcome.  
> Cheers,  
> Ian
> 
> --  
> 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 14, 2013, 5:18pm UTC](https://discuss.elastic.co/t/is-it-possible-for-query-results-to-include-the-time-geo-bounds-of-the-returned-documents/11949/4 "2013-05-14T17:18:57Z")

</div>

Sorry. I thought that you were looking to compute a String based on doc content itself.  
I have no more idea right now…

May be someone else???

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 14 mai 2013 à 14:34, ian mayo [ian@planetmayo.com](mailto:ian@planetmayo.com) a écrit :

> thanks for the prompt reply David,  
> the scripts capability would appear to just allow me to return the individual temporal/spatial bounds for each document - but I'm already getting these in my search returns 😉
> 
> I guess that in the NoSQL context the scripts would give me my Map function, but I still need a Reduce function to give me the overall range.
> 
> This seems similar to the facets query parameter: for the requested facets, this gives me a count of how many documents match that facet. I'm hoping for a similar capability that tells me the time-period, geo-bounds for the overall set of returns.
> 
> Cheers,  
> Ian
> 
> On Tuesday, 14 May 2013 09:38:22 UTC+1, David Pilato wrote:  
> May be script fields? [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/script-fields/)
> 
> --  
> David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
> @dadoonet | @elasticsearchfr | @scrutmydocs
> 
> Le 14 mai 2013 à 10:21, ian mayo [i...@planetmayo.com](mailto:i...@planetmayo.com) a écrit :
> 
> > I've got a faceted search page that's working really well, supported by Elasticsearch.
> > 
> > Many of my documents have start/end, plus geo-bounds attributes.
> > 
> > So, in addition to returning the matching documents, plus a list of facet scores, I'd like ES to return the temporal and spatial bounds of the matching documents.
> > 
> > i.e. a plain-english translation of the actual search returns would be "12 property rentals with free wifi are available for under $100 per week"
> > 
> > I wish to extend the returned info to received: "12 property rentals with free wifi are available for under $100 per week, the available dates range from 1st June to 12th July and they're located from 12.1N, 3.2E to 15.2N, 5.5E"
> > 
> > I can't find the terms to use in the API guide for this, but I don't really know what I'm looking for.
> > 
> > Any tips would be most welcome.  
> > Cheers,  
> > Ian
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [May 15, 2013, 9:55am UTC](https://discuss.elastic.co/t/is-it-possible-for-query-results-to-include-the-time-geo-bounds-of-the-returned-documents/11949/5 "2013-05-15T09:55:45Z")

</div>

I think you'd have to add 3 stats facets to your query to give the min/max  
of:

- available date
- location.lat
- location.lon

Note: you'd need to set your geo-loc field to index lat\_lon for this to  
work. Also, the lat & lon will not be correlated with each other, but I  
think that'd be ok for your case.

So:

curl -XPUT '[http://127.0.0.1:9200/test/?pretty=1](http://127.0.0.1:9200/test/?pretty=1)' -d '  
{  
"mappings" : {  
"test" : {  
"properties" : {  
"loc" : {  
"lat\_lon" : 1,  
"type" : "geo\_point"  
},  
"available" : {  
"type" : "date"  
}  
}  
}  
}  
}  
'

curl -XPOST '[http://127.0.0.1:9200/test/test?pretty=1](http://127.0.0.1:9200/test/test?pretty=1)' -d '  
{  
"loc" : {  
"lat" : 40,  
"lon" : 50  
},  
"available" : "2013-05-10"  
}  
'

curl -XPOST '[http://127.0.0.1:9200/test/test?pretty=1](http://127.0.0.1:9200/test/test?pretty=1)' -d '  
{  
"loc" : {  
"lat" : 42,  
"lon" : 49  
},  
"available" : "2013-05-12"  
}  
'

curl -XGET '[http://127.0.0.1:9200/test/test/\_search?pretty=1](http://127.0.0.1:9200/test/test/_search?pretty=1)' -d '  
{  
"facets" : {  
"lat" : {  
"statistical" : {  
"field" : "loc.lat"  
}  
},  
"lon" : {  
"statistical" : {  
"field" : "loc.lon"  
}  
},  
"available" : {  
"statistical" : {  
"field" : "available"  
}  
}  
},  
"size" : 0  
}  
'

# {

# "hits" : {

# "hits" : ,

# "max\_score" : 1,

# "total" : 2

# },

# "timed\_out" : false,

# "\_shards" : {

# "failed" : 0,

# "successful" : 5,

# "total" : 5

# },

# "facets" : {

# "lat" : {

# "count" : 2,

# "variance" : 1,

# "std\_deviation" : 1,

# "min" : 40,

# "max" : 42,

# "\_type" : "statistical",

# "mean" : 41,

# "total" : 82,

# "sum\_of\_squares" : 3364

# },

# "lon" : {

# "count" : 2,

# "variance" : 0.25,

# "std\_deviation" : 0.5,

# "min" : 49,

# "max" : 50,

# "\_type" : "statistical",

# "mean" : 49.5,

# "total" : 99,

# "sum\_of\_squares" : 4901

# },

# "available" : {

# "count" : 2,

# "variance" : 7.46495998217421e+15,

# "std\_deviation" : 86399999.8968415,

# "min" : 1368144000000,

# "max" : 1368316800000,

# "\_type" : "statistical",

# "mean" : 1368230400000,

# "total" : 2736460800000,

# "sum\_of\_squares" : 3.74410886989824e+24

# }

# },

# "took" : 8

# }

On Tue, May 14, 2013 at 7:20 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:

> Sorry. I thought that you were looking to compute a String based on doc  
> content itself.  
> I have no more idea right now…
> 
> May be someone else???
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)  
> | @scrutmydocs [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> 
> Le 14 mai 2013 à 14:34, ian mayo [ian@planetmayo.com](mailto:ian@planetmayo.com) a écrit :
> 
> thanks for the prompt reply David,  
> the scripts capability would appear to just allow me to return the  
> individual temporal/spatial bounds for each document - but I'm already  
> getting these in my search returns 😉
> 
> I guess that in the NoSQL context the scripts would give me my Map  
> function, but I still need a Reduce function to give me the overall range.
> 
> This seems similar to the facets query parameter: for the requested  
> facets, this gives me a count of how many documents match that facet. I'm  
> hoping for a similar capability that tells me the time-period, geo-bounds  
> for the overall set of returns.
> 
> Cheers,  
> Ian
> 
> On Tuesday, 14 May 2013 09:38:22 UTC+1, David Pilato wrote:
> 
> > May be script fields? [http://www](http://www).**[Elastic — The Search AI Company | Elastic](http://elasticsearch.org/guide/)**  
> > reference/api/search/script-\*\*fields/[http://www.elasticsearch.org/guide/reference/api/search/script-fields/](http://www.elasticsearch.org/guide/reference/api/search/script-fields/)
> > 
> > --  
> > _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)[http://elasticsearch.com/](http://elasticsearch.com/)  
> > \*  
> > @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)  
> > |_\* @scrutmydocs [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> > 
> > Le 14 mai 2013 à 10:21, ian mayo [i...@planetmayo.com](mailto:i...@planetmayo.com) a écrit :
> > 
> > I've got a faceted search page that's working really well, supported by  
> > Elasticsearch.
> > 
> > Many of my documents have start/end, plus geo-bounds attributes.
> > 
> > So, in addition to returning the matching documents, plus a list of facet  
> > scores, I'd like ES to return the temporal and spatial bounds of the  
> > matching documents.
> > 
> > i.e. a plain-english translation of the actual search returns would be  
> > "12 property rentals with free wifi are available for under $100 per week"
> > 
> > I wish to extend the returned info to received: "12 property rentals with  
> > free wifi are available for under $100 per week, _the available dates  
> > range from 1st June to 12th July and they're located from 12.1N, 3.2E to  
> > 15.2N, 5.5E_"
> > 
> > I can't find the terms to use in the API guide for this, but I don't  
> > really know what I'm looking for.
> > 
> > Any tips would be most welcome.  
> > Cheers,  
> > Ian
> > 
> > --  
> > 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 elasticsearc...@\*\*[googlegroups.com](http://googlegroups.com).  
> > For more options, visit [https://groups.google.com/\*\*groups/opt\_out](https://groups.google.com/**groups/opt_out)[https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out)  
> > .
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![ian\_mayo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ian_mayo/32/2324_2.png) [@ian\_mayo](https://discuss.elastic.co/u/ian_mayo)\
**Post date:** [May 15, 2013, 10:09am UTC](https://discuss.elastic.co/t/is-it-possible-for-query-results-to-include-the-time-geo-bounds-of-the-returned-documents/11949/6 "2013-05-15T10:09:08Z")

</div>

Wow, Clinton, thanks for generously taking the time to provide that  
guidance - it does look quite credible.

I look forward to giving it a go.

Cheers,  
Ian

On Wednesday, 15 May 2013 10:55:45 UTC+1, Clinton Gormley wrote:

> I think you'd have to add 3 stats facets to your query to give the min/max  
> of:
> 
> - available date
> - location.lat
> - location.lon

[...]

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![JaysonCordray](https://avatars.discourse-cdn.com/v4/letter/j/f9ae1b/32.png) [@JaysonCordray](https://discuss.elastic.co/u/JaysonCordray)\
**Post date:** [June 30, 2014, 6:36am UTC](https://discuss.elastic.co/t/is-it-possible-for-query-results-to-include-the-time-geo-bounds-of-the-returned-documents/11949/7 "2014-06-30T06:36:12Z")

</div>

As you know that the mobile phone signal jammer can cut off the signals of the mobile phones and soon make it impossible to make phone calls or send messages. In this way when you need the peaceful condition and want to stay in it, you can just use the best mobile phone jammer to help you achieve your goal. And now as the technology develops with high speed the advanced **[cell phone jammers](http://www.jammerinthebox.com/categories/Cellphone_Signal_Jammer/)** has come into the market and are well welcomed by the group of people who need the jammer product.

---

<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:19am UTC](https://discuss.elastic.co/t/is-it-possible-for-query-results-to-include-the-time-geo-bounds-of-the-returned-documents/11949/8 "2017-07-06T01:19:05Z")

</div>


