bchapuis commented on code in PR #724:
URL:
https://github.com/apache/incubator-baremaps/pull/724#discussion_r1262460197
##########
baremaps-core/src/main/java/org/apache/baremaps/iploc/IpLocObject.java:
##########
@@ -20,6 +20,10 @@ public record IpLocObject(
InetRange inetRange,
Coordinate coordinate,
String network,
- String country) {
+ String country,
+
+ String source,
+
+ String precision) {
Review Comment:
Would it make sense to use an enum for the precision?
##########
baremaps-core/src/main/java/org/apache/baremaps/geocoder/GeonamesDocumentMapper.java:
##########
@@ -35,13 +35,14 @@ public Document apply(GeonamesRecord record) {
document.add(new StoredField("latitude", record.getLatitude()));
document.add(new StoredField("asciiname", record.getAsciiname()));
document.add(new StoredField("alternatenames",
record.getAlternatenames()));
- document.add(new StoredField("featureClass", record.getFeatureClass()));
+ document.add(new StringField("featureClass", record.getFeatureClass(),
Field.Store.YES));
Review Comment:
Out of curiosity, why is the StringField better in this case?
##########
baremaps-server/src/main/java/org/apache/baremaps/server/GeocoderResource.java:
##########
@@ -54,15 +54,16 @@ public GeocoderResource(SearcherManager searcherManager) {
@GET
@javax.ws.rs.Path("/api/geocoder")
- public Response getIpToLocation(
+ public Response searchLocations(
@QueryParam("queryText") String queryText,
@QueryParam("countryCode") @DefaultValue("") String countryCode,
@QueryParam("limit") @DefaultValue("10") int limit) throws IOException {
if (queryText == null) {
throw new
WebApplicationException(Response.status(Response.Status.BAD_REQUEST)
.entity("The queryText parameter is mandatory").build());
}
- var query = new
GeonamesQueryBuilder().queryText(queryText).countryCode(countryCode).build();
+ var query = new GeonamesQueryBuilder()
+
.queryText(queryText).countryCode(countryCode).withScoringByPopulation().build();
Review Comment:
Should we use the key word "with" before each method? e.g. withQueryText.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]