<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Querying document schema with Math function in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/querying-document-schema-with-math-function/m-p/320252#M7253</link>
    <description>&lt;P&gt;Thanks Alain, I will test this new feature&lt;/P&gt;</description>
    <pubDate>Thu, 04 Sep 2014 13:51:14 GMT</pubDate>
    <dc:creator>Artmoni_Mobile</dc:creator>
    <dc:date>2014-09-04T13:51:14Z</dc:date>
    <item>
      <title>Querying document schema with Math function</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/querying-document-schema-with-math-function/m-p/320250#M7251</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I store GPS latitude and longitude in document schema and would like to query my document database and filter on the nearest points.&lt;/P&gt;
&lt;P&gt;A sample standard SQL query could looks like that:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;SELECT geo_latitude, geo_longitude, geo_name, geo_country_code AS country, 
  (DEGREES(
    ACOS(
      SIN(RADIANS(47.470779)) * SIN(RADIANS(geo_latitude)) + 
      COS(RADIANS(47.470779)) * COS(RADIANS(geo_latitude)) * 
      COS(RADIANS(-87.890699 - geo_longitude))
    ) 
  ) * 60 * 1.1515) 
AS distance FROM `MyDatabase`.`allCountries` ORDER BY distance ASC LIMIT 20 ;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Is there a way in Nuxeo to execute Math operation in NXQL or requesting postgresql database directly?&lt;/P&gt;
&lt;P&gt;Another solution could be to create a custom OperationChain and execute the Math operation in Java.&lt;/P&gt;
&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Mon, 25 Aug 2014 15:06:23 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/querying-document-schema-with-math-function/m-p/320250#M7251</guid>
      <dc:creator>Artmoni_Mobile</dc:creator>
      <dc:date>2014-08-25T15:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: Querying document schema with Math function</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/querying-document-schema-with-math-function/m-p/320251#M7252</link>
      <description>&lt;P&gt;A few aggregates functions where added in NXQL with &lt;A href="https://jira.nuxeo.com/browse/NXP-13708" target="test_blank"&gt;https://jira.nuxeo.com/browse/NXP-13708&lt;/A&gt; but not advanced one like yours.&lt;/P&gt;
&lt;P&gt;Actually, for queries on geographic areas, the most promising is the integration of Elasticsearch aggregation support that is being done. See the epic &lt;A href="https://jira.nuxeo.com/browse/NXP-14882" target="test_blank"&gt;https://jira.nuxeo.com/browse/NXP-14882&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;More specifically, geo-distance will also be &lt;A href="http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-geodistance-aggregation.html" target="test_blank"&gt;http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-geodistance-aggregation.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;This will be part of the 6.0 release.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Aug 2014 15:17:45 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/querying-document-schema-with-math-function/m-p/320251#M7252</guid>
      <dc:creator>Alain_ESCAFFRE</dc:creator>
      <dc:date>2014-08-25T15:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: Querying document schema with Math function</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/querying-document-schema-with-math-function/m-p/320252#M7253</link>
      <description>&lt;P&gt;Thanks Alain, I will test this new feature&lt;/P&gt;</description>
      <pubDate>Thu, 04 Sep 2014 13:51:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/querying-document-schema-with-math-function/m-p/320252#M7253</guid>
      <dc:creator>Artmoni_Mobile</dc:creator>
      <dc:date>2014-09-04T13:51:14Z</dc:date>
    </item>
  </channel>
</rss>

