Geographical Search

This feature is used to find a candidate near you through geographical search in simple and advance search methods.

The search is done using Geocodes/City, State, Country or a distance range. You can select different parameters for measuring the distance range like KM and mile.

The geoSearch is an optional parameter (query) that can be passed in the API request of Simple Search, Boolean Search, Free Text Search, Match, Match with ID, and Match with Multiple Sub-User Ids.

Once geoSearch is passed in the request parameter of above API's, it will return the resume/JD that fulfills the geoSearch query.
Note:
  • By dafault, when geoSearch is passed in the API request, the score for the returned resume/JD is reduced by 50%, and the remaining 50% score is allocated to the geoSearch query. To know more, see the sample Simple Search query below with and without geoSearch.
  • When the geoSearchScore parameter is included in the API request, the score assigned to the geoSearch query is determined by the value specified in the geoSearchScore parameter. This allows you to dynamically change the score for the geoSearch query using geoSearchScore parameter. For example, if "geoSearchScore": 20 is passed in the API request, then 20% of the score is assigned to the geoSearch query, and the remaining 80% is returned for the resume/JD.

Simple Search query without geoSearch - Request

{
    "index": {
        "indexType": "Resume",
        "indexKey": "Use Your indexKey",
        "ubUserId": "rchilli"
    },
    "query": {
        "keyword": "Assistant Professor with Java"
    },
    "geoSearch": {
        "longitude": "-76.61219000",
        "latitude": "39.27238000",
        "minRadius": 1,
        "maxRadius": 100
    },
    "pageSize": 10,
    "pageStart": 0,
    "explainScore": true,
    "explainScoreType": "json"
}

Simple Search query without geoSearch - Response

Note: Note the score for the document id: 5207077866431426 is 24 (when geoSearch is not passed).

Simple Search query with geoSearch - Request

{
    "index": {
        "indexType": "Resume",
        "indexKey": "Use Your indexKey",
        "ubUserId": "rchilli"
    },
    "query": {
        "keyword": "Assistant Professor with Java"
    },
    "geoSearch": {
        "longitude": "-76.61219000",
        "latitude": "39.27238000",
        "minRadius": 1,
        "maxRadius": 100
    },
    "pageSize": 10,
    "pageStart": 0,
    "explainScore": true,
    "explainScoreType": "json"
}

Simple Search query with geoSearch - Response

Note: The score for the document id: 5207077866431426 is 62 (when geoSearch is passed in the below request). The score for this id in the above request is 24 (when geoSearch is not passed in the request). The increase in the score is calculated as follows:
  • geoSearch score = 50
  • Document id score = 12 (reduced by 50%, Document id score was 24 in above request)
  • Total Score = 50+12 = 62.
{
    "count": 2,
    "pageStart": 0,
    "pageSize": 10,
    "records": [
        {
            "id": "2411180203491149P2M0PZIB",
            "score": 65.0,
            "CurrentEmployer": "ZDAAS",
            "TotalExperienceInYear": 20.8,
            "CurrentJobProfile": "Chief Information Officer",
            "City": "Baltimore",
            "FullName": "Amjad Nagrah",
            "Country": "USA",
            "State": "MD"
        },
        {
            "id": "2411180203301130VIUKH8UM",
            "score": 65.0,
            "CurrentEmployer": "ZDAAS",
            "TotalExperienceInYear": 20.8,
            "CurrentJobProfile": "Chief Information Officer",
            "City": "Baltimore",
            "FullName": "Amjad Nagrah",
            "Country": "USA",
            "State": "MD"
        }
    ],
    "explainScore": [
        {
            "id": "2411180203491149P2M0PZIB",
            "explaination": {
                "score": 65.0,
                "maxScore": 100.0,
                "SimpleSearch": {
                    "score": 15.0,
                    "maxScore": 50.0,
                    "detailScore": [
                        {
                            "score": 0.0,
                            "maxScore": 35.0,
                            "entity": "JobProfile",
                            "value": "Assistant Professor"
                        },
                        {
                            "score": 15.0,
                            "maxScore": 15.0,
                            "entity": "SkillHaveExp",
                            "value": "java"
                        }
                    ]
                },
                "geoSearch": {
                    "score": 50.0,
                    "maxScore": 50.0,
                    "detailScore": [
                        {
                            "Location": ",",
                            "GeoCode": "-76.61219000,39.27238000",
                            "MaxRadius": "100.0",
                            "MinRadius": "1.0"
                        }
                    ]
                }
            }
        },
        {
            "id": "2411180203301130VIUKH8UM",
            "explaination": {
                "score": 65.0,
                "maxScore": 100.0,
                "SimpleSearch": {
                    "score": 15.0,
                    "maxScore": 50.0,
                    "detailScore": [
                        {
                            "score": 0.0,
                            "maxScore": 35.0,
                            "entity": "JobProfile",
                            "value": "Assistant Professor"
                        },
                        {
                            "score": 15.0,
                            "maxScore": 15.0,
                            "entity": "SkillHaveExp",
                            "value": "java"
                        }
                    ]
                },
                "geoSearch": {
                    "score": 50.0,
                    "maxScore": 50.0,
                    "detailScore": [
                        {
                            "Location": ",",
                            "GeoCode": "-76.61219000,39.27238000",
                            "MaxRadius": "100.0",
                            "MinRadius": "1.0"
                        }
                    ]
                }
            }
        }
    ]
}

API request Parameters

Request parameters for geoSearch are described below:
Name Type Description Remarks
Option 1
city String Name of city Required
state String Name of state related to city Optional
country String Name of Country related to state Optional
minRadius Integer The minimum radius, from the specified Longitude/Latitude within which the search is performed. The default value is 0. Optional
distanceUnit String Default is KM (Kilometer). Possible values are KM and mile Optional
Option 2
longitude String Name of city Required
latitude String Name of state related to city Required
minRadius Integer The minimum radius, from the specified Longitude/Latitude within which the search is performed. The default value is 1. Optional
maxRadius Integer The maximum radius, from the specified Longitude/Latitude within which the search is performed. The default value is 1. Optional
distanceUnit String Default is KM (Kilometer). Possible values are KM and mile Optional

JSON request with geoSearch parameter (option 1)

"geoSearch": {
        "city": "Southampton",
        "state": "England",
        "country": "UK",
        "maxRadius": 50,
        "minRadius": 2
    },

JSON request with geoSearch parameter (option 2)

"geoSearch": {
        "longitude": "-95.41507000",
        "latitude": "29.71838000",
        "minRadius": 1,
        "maxRadius": 100
    },

Error codes

Table 1. Geographical Search Error Code
Error Code Error Message
2132 GeoSearch score must be 0 to 100
2133 GeoSearch score must be a number type
2165 invalid value for minRadius
2166 invalid value for minRadius. minRadius must be greater than 1 and less than radius value