dev-master
9999999-dev https://github.com/joacub/GeonamesServerZF2 module, index geonames data & provides a search API using Elasticsearch
MIT
The Requires
- php >=5.3.3
- zendframework/zendframework 2.*
by Johan
Wallogit.com
2017 © Pedro Peláez
ZF2 module, index geonames data & provides a search API using Elasticsearch
GeonamesServer is ZF2 module. It indexes geonames data & provides a search API using Elasticsearch.
Elasticsearch is a distributed, RESTful, open source search server based on Apache Lucene., (*1)
→ Demo
→ Composer package, (*2)
{
"geonameid": "2988507",
"country": "FR",
"name": "Paris",
"latitude": "48.85341",
"longitude": "2.3488",
"population": 2138551,
"timezone": "Europe/Paris",
"type": "city",
"parents": [
{
"geonameid": "2968815",
"name": "Paris",
"country": "FR",
"type": "ADM2"
},
{
"geonameid": "3012874",
"name": "Île-de-France",
"country": "FR",
"type": "ADM1"
},
{
"geonameid": "3017382",
"name": "France",
"country": "FR",
"type": "country"
}
]
}
cd my/project/directorycreate a composer.json file with following contents:, (*3)
json
{
"require": {
"ghislainf/geonames-server": "dev-master"
}
}, (*4)
curl -s http://getcomposer.org/installer | php (on windows, download
http://getcomposer.org/installer and execute it with PHP)php composer.phar install
open my/project/directory/configs/application.config.php and add the following key to your modules:, (*5)
php
'GeonamesServer',, (*6)
config/geonamesserver.local.php in my/project/directory/config/autoload
my/project/directory/config/autoload/geonamesserver.local.php, let yourself guided by comments.import geonames data in your elasticsearch index :, (*7)
shell
$ php public/index.php geonames_install, (*8)
, (*9)
GET /geonames/_search/{string_query}
GET /geonames/_search/{string_query}/{page}
GET /geonames/_search/{string_query}/{page}/{size}, (*10)
{page} and {size} are optional, by default {page} = 1 and {size} = 10, (*11)
GET /geonames/_get/{geonameid}
GET /geonames/_get/{geonameid},{geonameid},.., (*12)
ZF2 module, index geonames data & provides a search API using Elasticsearch
MIT