/index resource

The /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.

Refer Index Search Server Configuration


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

{
  "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
    },
    {
      "centroid": {
        "crs": "EPSG:3857",
        "x": 17025505.121,
        "y": -3462871.382
      },
      "display1": "10 Smith Street, Grafton, 2460",
      "display2": "",
      "entity": "property",
      "envelope": {
        "crs": "EPSG:3857",
        "maxx": 17025525.066,
        "maxy": -3462849.177,
        "minx": 17025486.628,
        "miny": -3462893.69
      },
      "id": "1724334_10_Smith_Street_14_Grafton_DP608106",
      "index": 2
    },
    {
      "centroid": {
        "crs": "EPSG:3857",
        "x": 16772635.771,
        "y": -3994389.361
      },
      "display1": "10-12 Smith Street, Emu Plains, 2750",
      "display2": "",
      "entity": "property",
      "envelope": {
        "crs": "EPSG:3857",
        "maxx": 16772659.876,
        "maxy": -3994368.333,
        "minx": 16772611.608,
        "miny": -3994410.449
      },
      "id": "2579093_10-12_Smith_Street_330_Emu_Plains_DP575290",
      "index": 3
    },
    {
      "centroid": {
        "crs": "EPSG:3857",
        "x": 16776066.032,
        "y": -3997518.097
      },
      "display1": "10 181 Smith Street, South Penrith, 2750",
      "display2": "",
      "entity": "property",
      "envelope": {
        "crs": "EPSG:3857",
        "maxx": 16776071.942,
        "maxy": -3997500.101,
        "minx": 16776060.111,
        "miny": -3997535.798
      },
      "id": "2579180_Unit_10_181_Smith_Street_85_South_Penrith_DP200452",
      "index": 4
    }
  ],
  "total": 4
}


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

{
  "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
    },
    {
      "centroid": {
        "crs": "EPSG:3857",
        "x": 17025505.121,
        "y": -3462871.382
      },
      "display1": "10 Smith Street, Grafton, 2460",
      "display2": "",
      "entity": "property",
      "envelope": {
        "crs": "EPSG:3857",
        "maxx": 17025525.066,
        "maxy": -3462849.177,
        "minx": 17025486.628,
        "miny": -3462893.69
      },
      "id": "1724334_10_Smith_Street_14_Grafton_DP608106",
      "index": 2
    },
    {
      "centroid": {
        "crs": "EPSG:3857",
        "x": 16772635.771,
        "y": -3994389.361
      },
      "display1": "10-12 Smith Street, Emu Plains, 2750",
      "display2": "",
      "entity": "property",
      "envelope": {
        "crs": "EPSG:3857",
        "maxx": 16772659.876,
        "maxy": -3994368.333,
        "minx": 16772611.608,
        "miny": -3994410.449
      },
      "id": "2579093_10-12_Smith_Street_330_Emu_Plains_DP575290",
      "index": 3
    },
    {
      "centroid": {
        "crs": "EPSG:3857",
        "x": 16776066.032,
        "y": -3997518.097
      },
      "display1": "10 181 Smith Street, South Penrith, 2750",
      "display2": "",
      "entity": "property",
      "envelope": {
        "crs": "EPSG:3857",
        "maxx": 16776071.942,
        "maxy": -3997500.101,
        "minx": 16776060.111,
        "miny": -3997535.798
      },
      "id": "2579180_Unit_10_181_Smith_Street_85_South_Penrith_DP200452",
      "index": 4
    }
  ],
  "total": 4
}


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
}