/index resource exposes the client API of the indexing capabilities of Weave such as index search.
For /index resource to function, appropriate Weave server configurations must be in place.
Top-level resource: services/v1/index
Sub-resources
1 - /index/search
Performs an index search for the given search query.
Parameters
GET request query parameters
query - string - search string
start - integer - starting index of the result subset
limit - number of search results to fetch
indexes - string array - index identifiers as per configuration
type - string constant - type of search:
WILDCARD - matches indexed values that contain all or part of the search term. If no results are found, a FUZZY search is attempted. E.g. "test" finds terms such as "tests" and "tester"
FUZZY - matches search indexed values based on the Levenshtein Distance. If no results are found, then a WILDCARD search is attempted, E.g. "roam" finds terms such as "roams" and "foam"
EXACT - matches the exact search term. If no results are found, then WILDCARD and FUZZY searches are attempted in that order till results are found
WILDCARDONLY - only perform a WILDCARD type search
FUZZYONLY - only performs a FUZZY type search
EXACTONLY - only performs a EXACT type search
crs - Coordinate reference system to present the search results in
The following examples explain how each search type responds to the search term "10 Smith Street, 2760"
Example 1 - EXACTONLY search
curl -X GET --header 'Accept: application/json' 'http://localhost:8080/weave/services/v1/index/search?query=10%20Smith%20Street%2C%202760&start=0&limit=10&indexes=idx.property&type=EXACTONLY&crs=EPSG%3A3857'
Output
{ "results": [ { "centroid": { "crs": "EPSG:3857", "x": 16783036.488, "y": -3998664.491 }, "display1": "10 Smith Street, St Marys, 2760", "display2": "", "entity": "property", "envelope": { "crs": "EPSG:3857", "maxx": 16783045.638, "maxy": -3998643.358, "minx": 16783027.292, "miny": -3998685.564 }, "id": "3113662_10_Smith_Street_43_St_Marys_DP2488", "index": 1 } ], "total": 1 }
Example 2 - EXACT search
curl -X GET --header 'Accept: application/json' 'http://localhost:8080/weave/services/v1/index/search?query=10%20Smith%20Street%2C%202760&start=0&limit=10&indexes=idx.property&type=EXACT&crs=EPSG%3A3857'
Output
{ "results": [ { "centroid": { "crs": "EPSG:3857", "x": 16783036.488, "y": -3998664.491 }, "display1": "10 Smith Street, St Marys, 2760", "display2": "", "entity": "property", "envelope": { "crs": "EPSG:3857", "maxx": 16783045.638, "maxy": -3998643.358, "minx": 16783027.292, "miny": -3998685.564 }, "id": "3113662_10_Smith_Street_43_St_Marys_DP2488", "index": 1 } ], "total": 1 }
Example 3 - FUZZYONLY search
curl -X GET --header 'Accept: application/json' 'http://localhost:8080/weave/services/v1/index/search?query=10%20Smith%20Street%2C%202760&start=0&limit=10&indexes=idx.property&type=FUZZYONLY&crs=EPSG%3A3857'
Output
Example 4 - FUZZY search
curl -X GET --header 'Accept: application/json' 'http://localhost:8080/weave/services/v1/index/search?query=10%20Smith%20Street%2C%202760&start=0&limit=10&indexes=idx.property&type=FUZZY&crs=EPSG%3A3857'
Output
Example 5 - WILDCARDONLY search
curl -X GET --header 'Accept: application/json' 'http://localhost:8080/weave/services/v1/index/search?query=10%20Smith%20Street%2C%202760&start=0&limit=10&indexes=idx.property&type=WILDCARDONLY&crs=EPSG%3A3857'
Output
{ "results": [ { "centroid": { "crs": "EPSG:3857", "x": 16783036.488, "y": -3998664.491 }, "display1": "10 Smith Street, St Marys, 2760", "display2": "", "entity": "property", "envelope": { "crs": "EPSG:3857", "maxx": 16783045.638, "maxy": -3998643.358, "minx": 16783027.292, "miny": -3998685.564 }, "id": "3113662_10_Smith_Street_43_St_Marys_DP2488", "index": 1 } ], "total": 1 }