diff --git a/Doxygen/Examples.AvocadoDB/api-index-create-geo-latitude-longitude b/Doxygen/Examples.AvocadoDB/api-index-create-geo-latitude-longitude index b40d703455..fda16cf8a3 100644 --- a/Doxygen/Examples.AvocadoDB/api-index-create-geo-latitude-longitude +++ b/Doxygen/Examples.AvocadoDB/api-index-create-geo-latitude-longitude @@ -11,7 +11,8 @@ content-type: application/json "f" ], "id": "164647097/165564601", - "type": "geo", + "type": "geo2", + "constraint" : false, "isNewlyCreated": true, "error": false } diff --git a/Doxygen/Examples.AvocadoDB/api-index-create-geo-location b/Doxygen/Examples.AvocadoDB/api-index-create-geo-location index 713a34039a..5b5506950e 100644 --- a/Doxygen/Examples.AvocadoDB/api-index-create-geo-location +++ b/Doxygen/Examples.AvocadoDB/api-index-create-geo-location @@ -11,7 +11,8 @@ content-type: application/json "b" ], "id": "161370297/162222265", - "type": "geo", + "type": "geo1", + "constraint" : false, "isNewlyCreated": true, "error": false } diff --git a/RestServer/index-geo.dox b/RestServer/index-geo.dox index f72dad0c04..73049c4c63 100644 --- a/RestServer/index-geo.dox +++ b/RestServer/index-geo.dox @@ -29,6 +29,11 @@ /// @page IndexGeoTOC /// ///
    +///
  1. @ref IndexGeoHttp +///
      +///
    1. @ref IndexGeoHttpEnsureGeo "Creating a Geo Index/Constraint POST /_api/index"
    2. +///
    +///
  2. ///
  3. @ref IndexGeoShell ///
      ///
    1. @ref IndexGeoShellEnsureGeoIndex "collection.ensureGeoIndex"
    2. @@ -38,8 +43,6 @@ ///
    3. @ref IndexGeoShellWithin "collection.within"
    4. ///
    ///
  4. -///
  5. @ref IndexGeoHttp -///
  6. ///
//////////////////////////////////////////////////////////////////////////////// @@ -62,7 +65,14 @@ /// requirements. /// /// A geo-spatial constraint makes the same assumptions, but documents -/// not fulfill the requirements are rejected. +/// not fulfilling these requirements are rejected. +/// +/// @section IndexGeoHttp Accessing Geo Indexes via Http +//////////////////////////////////////////////////////// +/// +/// @anchor IndexGeoHttpEnsureGeo +/// @copydetails JSF_POST_api_index_geo +///
/// /// @section IndexGeoShell Accessing Geo Indexes from the Shell /////////////////////////////////////////////////////////////// @@ -85,9 +95,6 @@ /// /// @anchor IndexGeoShellWithin /// @copydetails JSF_AvocadoCollection_prototype_within -/// -/// @section IndexGeoHttp Accessing Geo Indexes via Http -//////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// // Local Variables: diff --git a/V8/V8LineEditor.cpp b/V8/V8LineEditor.cpp index 83e658e7ba..cba1e411ea 100644 --- a/V8/V8LineEditor.cpp +++ b/V8/V8LineEditor.cpp @@ -226,7 +226,7 @@ static char** AttemptedCompletion (char const* text, int start, int end) { /// @brief constructs a new editor //////////////////////////////////////////////////////////////////////////////// -V8LineEditor::V8LineEditor (v8::Handle context, string const& history) +V8LineEditor::V8LineEditor (v8::Handle context, std::string const& history) : LineEditor(history), _context(context) { } diff --git a/V8/v8-vocbase.cpp b/V8/v8-vocbase.cpp index 57ee0e85a8..7c17c06a26 100644 --- a/V8/v8-vocbase.cpp +++ b/V8/v8-vocbase.cpp @@ -4387,7 +4387,7 @@ static v8::Handle JS_EnsureGeoIndexVocbaseCol (v8::Arguments const& a /// @FUN{@FA{collection}.ensureGeoConstraint(@FA{latitude}, @FA{longitude}, @FA{ignore-null})} /// /// Works like @FN{ensureGeoIndex} but requires that the documents contain -/// a valid geo definition. If @FA{ignore-null} is true, than documents with +/// a valid geo definition. If @FA{ignore-null} is true, then documents with /// a null in @FA{location} or at least one null in @FA{latitude} or /// @FA{longitude} are ignored. //////////////////////////////////////////////////////////////////////////////// @@ -4399,7 +4399,7 @@ static v8::Handle JS_EnsureGeoConstraintVocbaseCol (v8::Arguments con //////////////////////////////////////////////////////////////////////////////// /// @brief ensures that a hash index exists /// -/// @FUN{ensureUniqueConstrain(@FA{field1}, @FA{field2}, ...,@FA{fieldn})} +/// @FUN{ensureUniqueConstraint(@FA{field1}, @FA{field2}, ...,@FA{fieldn})} /// /// Creates a hash index on all documents using attributes as paths to the /// fields. At least one attribute must be given. The value of this attribute @@ -4978,7 +4978,7 @@ static v8::Handle JS_RenameVocbaseCol (v8::Arguments const& argv) { /// @FUN{@FA{collection}.replace(@FA{document}, @FA{data})} /// /// Replaces an existing @FA{document}. The @FA{document} must be a document in -/// the current collection. This document is than replaced with the +/// the current collection. This document is then replaced with the /// @FA{data} given as second argument. /// /// The method returns a document with the attributes @LIT{_id}, @LIT{_rev} and @@ -5479,7 +5479,7 @@ static v8::Handle JS_CompletionsVocBase (v8::Arguments const& argv) { /// @FUN{db._create(@FA{collection-name})} /// /// Creates a new collection named @FA{collection-name}. If the collection name -/// already exists, than an error is thrown. The default value for +/// already exists, then an error is thrown. The default value for /// @LIT{waitForSync} is @LIT{false}. /// /// @FUN{db._create(@FA{collection-name}, @FA{properties})} @@ -5754,7 +5754,7 @@ static v8::Handle JS_CollectionsEdges (v8::Arguments const& argv) { /// @FUN{edges._create(@FA{collection-name})} /// /// Creates a new collection named @FA{collection-name}. If the collection name -/// already exists, than an error is thrown. The default value for +/// already exists, then an error is thrown. The default value for /// @LIT{waitForSync} is @LIT{false}. /// /// @FUN{edges._create(@FA{collection-name}, @FA{properties})} diff --git a/js/actions/system/api-index.js b/js/actions/system/api-index.js index 77a3e9e139..7b87065602 100644 --- a/js/actions/system/api-index.js +++ b/js/actions/system/api-index.js @@ -154,6 +154,59 @@ function GET_api_index (req, res) { //////////////////////////////////////////////////////////////////////////////// /// @brief creates a geo index +/// +/// @REST{POST /_api/index?collection=@FA{collection-identifier}} +/// +/// Creates a geo-spatial index in the collection @FA{collection-identifier}, if +/// it does not already exist. Expects an object containing the index details. +/// +/// - @LIT{type}: must be equal to @LIT{"geo"}. +/// +/// - @LIT{fields}: A list with one or two attribute paths.
+///
+/// If it is a list with one attribute path @FA{location}, then a geo-spatial +/// index on all documents is created using @FA{location} as path to the +/// coordinates. The value of the attribute must be a list with at least two +/// double values. The list must contain the latitude (first value) and the +/// longitude (second value). All documents, which do not have the attribute +/// path or with value that are not suitable, are ignored.
+///
+/// If it is a list with two attribute paths @FA{latitude} and @FA{longitude}, +/// then a geo-spatial index on all documents is created using @FA{latitude} +/// and @FA{longitude} as paths the latitude and the longitude. The value of +/// the attribute @FA{latitude} and of the attribute @FA{longitude} must a +/// double. All documents, which do not have the attribute paths or which +/// values are not suitable, are ignored. +/// +/// - @LIT{geoJson}: If a geo-spatial index on a @FA{location} is constructed +/// and @LIT{geoJson} is @LIT{true}, then the order within the list is longitude +/// followed by latitude. This corresponds to the format described in
+///
+/// http://geojson.org/geojson-spec.html#positions +/// +/// - @LIT{constraint}: If @LIT{constraint} is @LIT{true}, then a geo-spatial +/// constraint instead of an index is created. +/// +/// - @LIT{ignoreNull}: If a geo-spatial constraint is created and +/// @FA{ignoreNull} is true, then documents with a null in @FA{location} or at +/// least one null in @FA{latitude} or @FA{longitude} are ignored. +/// +/// If the index does not already exists and could be created, then a @LIT{HTTP +/// 201} is returned. If the index already exists, then a @LIT{HTTP 200} is +/// returned. +/// +/// If the @FA{collection-identifier} is unknown, then a @LIT{HTTP 404} is +/// returned. It is possible to specify a name instead of an identifier. +/// +/// @EXAMPLES +/// +/// Creating a geo index with a location attribute: +/// +/// @verbinclude api-index-create-geo-location +/// +/// Creating a geo index with latitude and longitude attributes: +/// +/// @verbinclude api-index-create-geo-latitude-longitude //////////////////////////////////////////////////////////////////////////////// function POST_api_index_geo (req, res, collection, body) { @@ -321,14 +374,6 @@ function POST_api_index_skiplist (req, res, collection, body) { /// /// @EXAMPLES /// -/// Creating a geo index with a location attribute: -/// -/// @verbinclude api-index-create-geo-location -/// -/// Creating a geo index with latitude and longitude attributes: -/// -/// @verbinclude api-index-create-geo-latitude-longitude -/// /// Creating an unique constraint: /// /// @verbinclude api-index-create-new-unique-constraint