mirror of https://gitee.com/bigwinds/arangodb
start geo documentation - commit for test building
This commit is contained in:
parent
659699a11e
commit
d1ac87f58b
|
@ -90,6 +90,23 @@ Create a geo index for a hash array attribute:
|
|||
@END_EXAMPLE_ARANGOSH_OUTPUT
|
||||
@endDocuBlock geoIndexCreateForArrayAttribute2
|
||||
|
||||
Use GeoIndex with AQL SORT statement:
|
||||
|
||||
@startDocuBlockInline geoIndexSortOptimization
|
||||
@EXAMPLE_ARANGOSH_OUTPUT{geoIndexSortOptimization}
|
||||
~db._create("geo3")
|
||||
db.geo2.ensureIndex({ type: "geo", fields: [ "location.latitude", "location.longitude" ] });
|
||||
| for (i = -90; i <= 90; i += 10) {
|
||||
| for (j = -180; j <= 180; j += 10) {
|
||||
| db.geo2.save({ name : "Name/" + i + "/" + j, location: { latitude : i, longitude : j } });
|
||||
| }
|
||||
}
|
||||
var query = "FOR doc in geo3 SORT distance(doc.location.latitude, doc.location.longitude,0,0) LIMIT 100 RETURN doc"
|
||||
db._explain(query);
|
||||
db._execute(query);
|
||||
~db._drop("geo3")
|
||||
@END_EXAMPLE_ARANGOSH_OUTPUT
|
||||
@endDocuBlock geoIndexSortOptimization
|
||||
|
||||
<!-- js/common/modules/@arangodb/arango-collection-common.js-->
|
||||
@startDocuBlock collectionGeo
|
||||
|
|
|
@ -273,8 +273,10 @@ The geo index provides operations to find documents with coordinates nearest to
|
|||
comparison coordinate, and to find documents with coordinates that are within a specifiable
|
||||
radius around a comparison coordinate.
|
||||
|
||||
The geo index is used via dedicated functions in AQL or the simple queries functions,
|
||||
but will not be used for other types of queries or conditions.
|
||||
The geo index is used via dedicated functions in AQL, the simple queries
|
||||
functions, and it is implicitly applied when in AQL a SORT or FILTER is used with
|
||||
the distance function. Otherwise it will not be used for other types of queries
|
||||
or conditions.
|
||||
|
||||
|
||||
### Fulltext Index
|
||||
|
|
|
@ -71,7 +71,10 @@ different usage scenarios:
|
|||
|
||||
{ "coords": [ 50.9406645, 6.9599115 ] }
|
||||
|
||||
Geo indexes will only be invoked via special functions.
|
||||
Geo indexes will be invoked via special functions or AQL optimization. The
|
||||
optimization can be triggered when a collection with geo index is enumerated
|
||||
and a SORT or FILTER statement is used in conjunction with the distance
|
||||
function.
|
||||
|
||||
- fulltext index: a fulltext index can be used to index all words contained in
|
||||
a specific attribute of all documents in a collection. Only words with a
|
||||
|
|
|
@ -0,0 +1,66 @@
|
|||
#!/bin/bash
|
||||
|
||||
##python3-setuptools
|
||||
##
|
||||
##python setup.py install
|
||||
##
|
||||
##node npm
|
||||
##
|
||||
##https://github.com/GitbookIO/gitbook
|
||||
## npm install gitbook-cli -g
|
||||
##
|
||||
## http://calibre-ebook.com/download
|
||||
|
||||
test_tools(){
|
||||
if ! type easy_install3 >> /dev/null; then
|
||||
echo "you are missing setuptools"
|
||||
echo "apt-get install python-setuptools"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! type node >> /dev/null; then
|
||||
echo "you are missing node"
|
||||
echo "apt-get install nodejs nodejs-legacy"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! type npm >> /dev/null; then
|
||||
echo "you are missing node"
|
||||
echo "apt-get install npm"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! type calibre >> /dev/null; then
|
||||
echo "you are missing node"
|
||||
echo "apt-get install calibre-bin"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
install_tools(){
|
||||
(
|
||||
if ! [[ -f markdown-pp ]]; then
|
||||
git clone https://github.com/arangodb-helper/markdown-pp/
|
||||
fi
|
||||
cd markdown-pp
|
||||
python2 setup.py install --user
|
||||
)
|
||||
npm install gitbook-cli
|
||||
|
||||
|
||||
}
|
||||
|
||||
main(){
|
||||
#test for basic tools
|
||||
test_tools
|
||||
|
||||
#cd into target dir
|
||||
mkdir -p "$1"
|
||||
cd $1 || { echo "unable to change into $1"; exit 1; }
|
||||
|
||||
install_tools
|
||||
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
Loading…
Reference in New Issue