Download the PHP package ghislainf/geonames-server without Composer
On this page you can find all versions of the php package ghislainf/geonames-server. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ghislainf/geonames-server
More information about ghislainf/geonames-server
Files in ghislainf/geonames-server
Package geonames-server
Short Description ZF2 module, index geonames data & provides a search API using Elasticsearch
License MIT
Homepage https://github.com/ghislainf/GeonamesServer
Informations about the package geonames-server
GeonamesServer
Introduction
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.
→ Demo
→ Composer package
Elasticsearch index mapping
Module installation
- install elasticsearch
cd my/project/directory
-
create a
composer.json
file with following contents: - install composer via
curl -s http://getcomposer.org/installer | php
(on windows, download http://getcomposer.org/installer and execute it with PHP) - run
php composer.phar install
-
open
my/project/directory/configs/application.config.php
and add the following key to yourmodules
: - copy
config/geonamesserver.local.php
inmy/project/directory/config/autoload
- edit
my/project/directory/config/autoload/geonamesserver.local.php
, let yourself guided by comments. -
import geonames data in your elasticsearch index :
Use API
Search :
GET /geonames/_search/{string_query}
GET /geonames/_search/{string_query}/{page}
GET /geonames/_search/{string_query}/{page}/{size}
{page}
and {size}
are optional, by default {page} = 1
and {size} = 10
Get document :
GET /geonames/_get/{geonameid}
GET /geonames/_get/{geonameid},{geonameid},..