driver-core/src/main/com/mongodb/client/model/Indexes.java
public static Bson geoHaystack(final String fieldName, final Bson additional) {
        notNull("fieldName", fieldName);
        return compoundIndex(new BsonDocument(fieldName, new BsonString("geoHaystack")), additional);
    }
public static Bson geoHaystack(final String fieldName, final Bson additional) {
        notNull("fieldName", fieldName);
        return compoundIndex(new BsonDocument(fieldName, new BsonString("geoHaystack")), additional);
    }
Create an index key for a geohaystack index on the given field.

<p>
<strong>Note: </strong>For queries that use spherical geometry, a 2dsphere index is a better option than a haystack index.
2dsphere indexes allow field reordering; geoHaystack indexes require the first field to be the location field. Also, geoHaystack
indexes are only usable via commands and so always return all results at once..
</p>

@param fieldName the field to create a geoHaystack index on
@param additional the additional field that forms the geoHaystack index key
@return the index specification
@mongodb.driver.manual core/geohaystack geoHaystack index