Skip to content

Instantly share code, notes, and snippets.

View FrancescaK's full-sized avatar

Francesca Krihely FrancescaK

View GitHub Profile
dbpath=<some path>
logpath=<some path>
fork=true
auth = true
setParameter = authenticationMechanisms=GSSAPI
sslOnNormalPorts = true
sslPEMKeyFile = /etc/ssl/mongodb.pem
[logging]
default = FILE:/var/log/krb5libs.log
kdc = FILE:/var/log/krb5kdc.log
admin_server = FILE:/var/log/kadmind.log
[libdefaults]
default_realm = MONGOTEST.COM
dns_lookup_realm = false
dns_lookup_kdc = false
ticket_lifetime = 24h
mongo-connector -m localhost:27017 -t localhost:9200 --fields title,text -d mongo_connector/doc_managers/elastic_doc_manager.py
@FrancescaK
FrancescaK / gist:4a2882c096f8d0552dd2
Last active August 29, 2015 14:05
mongoconnector_3
mongo-connector -m localhost:27017 -t localhost:9200 -d mongo_connector/doc_managers/elastic_doc_manager.py
curl -XPOST ‘http://localhost:9200/reddit.posts/_search’ -d’{
"query": {
"match": {
"title": {
"query": "kiten",
"fuzziness": 2,
"prefix_length": 1
}
}
}
curl -XPOST ‘http://localhost:9200/reddit.posts/_search’ -d’{
"query": {
"match": {
"title": {
"query": "kitten",
"fuzziness": 2,
"prefix_length": 1
}
}
}
function cleanUpLong(max_running_secs) {
var currentOps = db.currentOp({
$and: [{ op: "query" },
{ msg: { $exists: false } }, // not a sharding operation!
{
secs_running: { $gt: max_running_secs }
},
{"ns": "backstage.action_loc" }]
});
currentOps.inprog.forEach(function (op) {
db.action_loc.ensureIndex({ location : "2dsphere", time : 1 })
{
"location" : {
"type" : "Point",
"coordinates" : [ Double, Double ]
}
}
db.location.ensureIndex({ location : "2d", time : 1 })