Python (32-bit) must be installed on the Voyager Server machine. Ideally, the Python version should be 2.7.
DO NOT USE EARLIER VERSIONS OF PYTHON
Alternatively, the Python installer shipped with ArcGIS 10.1/10.2 can be used to install Python. NOTE: If ArcGIS 10.1 or 10.2 is installed, Python is likely to already be installed.
After confirming the dependencies, you need to add a new location.
To create a new location:
This configuration indexes all the tables in a SQL Server database. It includes all the fields and maps only one field for all tables. The use of the asterisk (*) in this configuration means to include all fields, all tables and apply the field mapping in all tables.
{
"name": "SQLServer_Sample1",
"type": "python",
"config": {
"fields": {
"include": ["*"]
},
"tables": [
{
"name": "*",
"action": "INCLUDE"
},
{
"name": "*",
"map": {
"NAME ": "name"
}
} ],
"sql": {"connection": {
"driver": "SQL Server",
"server": "VOYAGER",
"database": "VOYAGERTEST",
"uid": "",
"pwd": ""
}
}
}
}
Index a single table.
{
"name": "WORLD_CITIES",
"type": "python",
"config": {
"fields": {
"include": ["*"]
},
"tables": [
{
"name": "CITIES",
"action": "INCLUDE"
},
{
"name": "*",
"map": {
"NAME ": "name"
}
} ],
"sql": {"connection": {
"driver": "SQL Server",
"server": "VOYAGER",
"database": "VOYAGERTEST",
"uid": "",
"pwd": ""
}
}
}
}
This example demonstrates the following:
{
"name": "A SQL Server Location",
"type": "python",
"config": {
"fields": {"include": ["*"]},
"tables": [
{
"name": "STATES",
"action": "INCLUDE",
"map": {"STATE_NAME": "name"},
"query": "select * from STATES where STATE_NAME = 'California'"
},
{
"name": "CITIES",
"map": {"CITY_NAME": "name"},
"constraint": "select * from CITIES where POP1990 > 100000 and STATE_NAME = 'California'"
}
],
"sql": {"connection": {
"driver": "SQL Server",
"server": "VOYAGER ",
"database": "VOYAGERTEST",
"uid": "",
"pwd": ""
}}
}
}
SQL Server supports the ability to index related tables as links. This example demonstrates the following:
{
"name": "A SQL Server Location",
"type": "python",
"config": {
"fields": {"include": ["*"]},
"tables":[
{
"name":"STATES",
"action": "INCLUDE",
"map":{"STATE_NAME":"name"},
"related_tables": ["CITIES"],
"query":"select * from STATES,CITIES where STATES.STATE_NAME=CITIES.STATE_NAME ORDER BY STATES.STATE_NAME"
},
{
"name": "CITIES",
"map": {"CITY_NAME": "name"}
}
],
"sql": {"connection": {
"driver": "SQL Server",
"server": "VOYAGER ",
"database": "VOYAGERTEST",
"uid": "",
"pwd": ""
}}
}
}
As shown in this illustration, the state will now have linked items. For example, the state of California will contain cities such as San Diego, Fresno, etc.
