Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
Hawksearch Versions: Hawksearch v4.0. Additional implementation changes might be needed to use this feature.
Note: Geolocation Search feature is already available for Hawksearch v4.0L clients. Please contact your Client Success Director for details and implementation.
Search: Dashboard Configuration
We have added a new range facet option - a Distance facet type which allows our customers to narrow down a list of results and sort them by distance within a chosen range. Your site visitors can now search by a zip code and get back list of relevant search results. This functionality will allow them to see the store location/products available in the physical location closest to them.
Fields
The first step to setting up Geolocation Search is to add a location field to your attribute.txt file and add a Location field under Workbench → Data Configuration → Fields. Make sure that this field is saved as a GeoPoint Value as shown below:
More information about setting up Fields can be found here.
Once the field is set up, the next step is adding a Distance facet.
Facets
Distance facet falls under the Range facet type. A Location field needs to be passed to Hawksearch in feeds. Use the following configuration to set up a Geolocation Search facet:
You can choose preferred Distance Unit Type:
And Distance Calculation Type:
An Arc length is the distance between two points along a section of a curve
A Plane length is a flat surface with no thickness
Also, distance range facet values need to be set up:
More information about setting up Facets can be found here.
Setting Up Sorting Set for Distance Facet
Geolocation Search should be set up as a separate sorting set as it will only apply when a user is searching by zip code.
To define a Nearest option – please select sorting value with an option ‘Sort By’ equal to Asc
To define a Farthest option – please select sorting value with an option ‘Sort By’ equal to Desc
In a display rule a condition needs to be added to trigger this sorting set. We want to use this sorting set, only when a distance facet selection is made.
Display rule is defined as: Location is not {{empty}}
Sample setup:
For more information, please follow instructions on sorting sets refinement: Sorting/Pagination
Implementation Details
Note: Please review this article if you are not sure where to find your client guid.
Indexing Geo Location
Attribute file must contain latitude and longitude information for each item.
After fields configuration, the index needs to be rebuilt.
Put a ‘lat’ and ‘long’ values for the fields defined as geolocation:
Even though the API request contains latitude and longitude, we have a mode where you can also pass a zip code in for tracking purposes. It is important to pass zip code in the object shown below if you are looking to see reporting around geolocation search. If zip code is not passed, no data will be tracked.
In order to track data for reporting, the following information needs to be passed to Hawksearch:
A new string property ZipCode has been added under ClientData object
To trigger a zip code search, ZipCode and Origin lat/lon must be passed
Please note that zip codes that were searched for will appear in the Keyword column within Hawksearch Search reports.
Best Practices
As a best practice we recommend to use this facet for searches under 250 miles radius for performance reasons. If you are looking to pull in results for a larger radius or see all possible results, a different approach may need to be chosen. Please reach out to our Support or Client Success Directors teams should you have questions.