Created
January 16, 2018 08:07
-
-
Save erick-otenyo/354238364ae5641d23d4dbb6da98bc94 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function(doc) { | |
if (doc.category === "venue") { | |
if (doc.name) { | |
index("name", doc.name, {"store": true,"index": true}); | |
} | |
if (doc.geometry) { | |
index("lon", doc.geometry.coordinates[0], {"store": true,"index":false}); | |
index("lat", doc.geometry.coordinates[1], {"store": true,"index":false}); | |
} | |
if (doc.price_per_hour) { | |
index("price_per_hour", doc.price_per_hour, {"store": true,"index": true}); | |
} | |
if (doc.activities) { | |
for (var i in doc.activities) { | |
if (doc.activities.hasOwnProperty(i)) { | |
index(i, doc.activities[i]); | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment