Navigation Menu

Skip to content

Commit

Permalink
doc: add Geo prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
kenhys committed Apr 28, 2015
1 parent 40e87cc commit 0eab8c3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions doc/source/tutorial/index.rst
Expand Up @@ -105,17 +105,19 @@ Groonga is very fast because it use such indexes against the column which contai

.. groonga-command
.. include:: ../example/tutorial/index-6.log
.. table_create --name GeoSite --flags TABLE_HASH_KEY --key_type ShortText
.. column_create --table GeoSite --name location --type WGS84GeoPoint
.. table_create --name GeoIndex --flags TABLE_PAT_KEY --key_type WGS84GeoPoint
.. column_create --table GeoIndex --name index_point --type Site --flags COLUMN_INDEX --source location
.. load --table Site
.. column_create --table GeoIndex --name index_point --type GeoSite --flags COLUMN_INDEX --source location
.. load --table GeoSite
.. [
.. {"_key":"http://example.org/","location":"128452975x503157902"},
.. {"_key":"http://example.net/","location":"128487316x502920929"}
.. ]
.. select --table Site --filter 'geo_in_circle(location, "128515259x503187188", 5000)' --output_columns _key,location
.. select --table GeoSite --filter 'geo_in_circle(location, "128515259x503187188", 5000)' --output_columns _key,location
These indexes are also used when sorting the records with geo location search.

.. groonga-command
.. include:: ../example/tutorial/index-7.log
.. select --table Site --filter 'geo_in_circle(location, "128515259x503187188", 50000)' --output_columns _key,location,_score --sortby '-geo_distance(location, "128515259x503187188")' --scorer '_score = geo_distance(location, "128515259x503187188")'
.. select --table GeoSite --filter 'geo_in_circle(location, "128515259x503187188", 50000)' --output_columns _key,location,_score --sortby '-geo_distance(location, "128515259x503187188")' --scorer '_score = geo_distance(location, "128515259x503187188")'

0 comments on commit 0eab8c3

Please sign in to comment.