--- title: GeoIndexer keywords: fastai sidebar: home_sidebar nb_path: "nbs/indexers.GeoIndexer.ipynb" ---
This module describes the GeoIndexer, a toy example of how we can build an indexer and use it to add new items to the pod.
This Indexer is super simple, we use it to describe the steps that we need to take to run an Indexer in general. First, lets create a test dataset. We initialize items and add them to an IndexerData object.
client = PodClient()
location = Location.from_data(latitude=-37.81, longitude=144.96)
address = Address.from_data()
address.add_edge("location", location)
data = IndexerData(items_with_location=[address])
And lets initialize an indexer.
indexer = GeoIndexer.from_data()
indexer_run = IndexerRun.from_data(progress=0, targetDataType="Address")
indexer_run.add_edge("indexer", indexer)
Now, we can run the indexer
items = indexer.index(data, indexer_run)
assert items[0].name == "Australia" and items[1].city == "Melbourne"
Finally, lets test the registration of our indexer
test_registration(GeoIndexer)
And we are done, it is as simple as that.