Skip to content

Instantly share code, notes, and snippets.

View debraj-manna's full-sized avatar

Debraj Manna debraj-manna

  • Spotnana
  • Bengaluru
View GitHub Profile
@pdu
pdu / glassdoor_cactus.py
Created January 2, 2013 14:09
find the number of spanning trees in a cactus graph
#!/usr/bin/python
def dfs(buf, flag, nodes, start, cur):
if flag[cur]:
if cur == start and len(nodes) != 2 and min(nodes) == start:
return len(nodes)
else:
return -1
flag[cur] = True
nodes.append(cur)
@reyjrar
reyjrar / elasticsearch.yml
Last active May 12, 2023 11:58
ElasticSearch config for a write-heavy cluster
##################################################################
# /etc/elasticsearch/elasticsearch.yml
#
# Base configuration for a write heavy cluster
#
# Cluster / Node Basics
cluster.name: logng
# Node can have abritrary attributes we can use for routing
@nz
nz / Delete all documents in a Solr index using curl.md
Last active February 12, 2024 10:55
Delete all documents in a Solr index using curl
# http://wiki.apache.org/solr/FAQ#How_can_I_delete_all_documents_from_my_index.3F
# http://wiki.apache.org/solr/UpdateXmlMessages#Updating_a_Data_Record_via_curl

curl "http://index.websolr.com/solr/a0b1c2d3/update?commit=true" -H "Content-Type: text/xml" --data-binary '<delete><query>*:*</query></delete>'

I'm amused at the traction this little gist is getting on Google! I would be remiss not to point out that six+ years later I'm still helping thousands of companies on a daily basis with their search index management, by providing managed Solr as a service over at Websolr, and hosted Elasticsearch at Bonsai. Check us out if you'd like an expert helping hand at Solr and Elasticsearch hosting, ops and support!