public class GeoNamesLuceneIndexer extends Object implements GeoEntryIndexer
Modifier and Type | Field and Description |
---|---|
static org.apache.lucene.search.similarities.ClassicSimilarity |
SIMILARITY |
Constructor and Description |
---|
GeoNamesLuceneIndexer() |
Modifier and Type | Method and Description |
---|---|
void |
setIndexLocation(String indexLocation) |
void |
updateIndex(List<GeoEntry> geoEntryList,
boolean create,
ProgressCallback progressCallback)
|
void |
updateIndex(String resource,
GeoEntryExtractor geoEntryExtractor,
boolean create,
ProgressCallback progressCallback)
Updates a GeoNames index with
GeoEntry objects extracted by a GeoEntryExtractor . |
public static final org.apache.lucene.search.similarities.ClassicSimilarity SIMILARITY
public void setIndexLocation(String indexLocation)
public void updateIndex(List<GeoEntry> geoEntryList, boolean create, ProgressCallback progressCallback) throws GeoEntryIndexingException
GeoEntryIndexer
updateIndex
in interface GeoEntryIndexer
geoEntryList
- the List
of GeoEntry
objects to add to the indexcreate
- true will create a new index and false will add to the existing indexprogressCallback
- the callback to receive updates about the indexing progress, may be
null if you don't want any updatesGeoEntryIndexingException
- if an error occurs while indexing the new entriespublic void updateIndex(String resource, GeoEntryExtractor geoEntryExtractor, boolean create, ProgressCallback progressCallback) throws GeoEntryIndexingException, GeoEntryExtractionException, GeoNamesRemoteDownloadException
GeoEntryIndexer
GeoEntry
objects extracted by a GeoEntryExtractor
.updateIndex
in interface GeoEntryIndexer
resource
- the resource containing GeoNames entriesgeoEntryExtractor
- the GeoEntryExtractor
that will extract GeoEntry
objects from resource
create
- true will create a new index and false will add to the existing indexprogressCallback
- the callback to receive updates about the indexing progress, may be
null if you don't want any updatesGeoEntryIndexingException
- if an error occurs while indexing the new entriesGeoEntryExtractionException
- if an error occurs while extracting GeoNames entries from
the resourceGeoNamesRemoteDownloadException
- if an error occurs while downloading from a remote
sourceThis work is licensed under a Creative Commons Attribution 4.0 International License.