Skip to content

Instantly share code, notes, and snippets.

View dapangmao's full-sized avatar
🏠
Working from home

Dapangmao dapangmao

🏠
Working from home
View GitHub Profile
@dapangmao
dapangmao / data.md
Last active September 28, 2023 06:50
Top 10 lessons learned from Dockerized Elasticsearch

Combining Docker and Elasticsearch together will make many things in life easier. Depending on the scales, there are three scenarios for an implementation of Elasticsearch use case -

    1. Single ES instance and single machine
    1. Multiple ES instances and single machine
    1. Multiple ES instances and multiple machines

Docker has three mechanisms corresponding to each of the scenarios above.

    1. Docker commands
    1. Docker Compose

Chapter 1 Getting in to Go

  • 1.1 What is Go?
  • 1.2 Noteworthy Aspects of Go
  • 1.2.1 Multiple Return Values
  • 1.2.2 A Modern Standard Library
  • 1.2.3 Concurrency with goroutines and channels
  • 1.2.4 Go the toolchain, more than a language
  • 1.3 Go in the vast language landscape
  • 1.3.1 C and Go
package main
import (
"io/ioutil"
"path/filepath"
"os"
"fmt"
"sync"
"flag"
"time"
.bootstrap {
/*!
* Bootstrap v3.3.7 (http://getbootstrap.com)
* Copyright 2011-2016 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */
}
.bootstrap html {
<link href="https://cdn.rawgit.com/dapangmao/a1813e270dec8d1f3383fca7ed0a3e9f/raw/fc2edcd37c839a84fe8ac576ec62b9da5f183870/bs.css" rel="stylesheet">
<script src="https://cdn.rawgit.com/Paul-DS/bootstrap-year-calendar/master/js/bootstrap-year-calendar.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.rawgit.com/Paul-DS/bootstrap-year-calendar/master/css/bootstrap-year-calendar.css">
<div class="bootstrap" id="calendar" data-provide="calendar" style="margin-bottom: 30px"></div>
<script>
$(function () {
from loc.models.index import get_solr_connection
from loc.models.index import solr_safe_value
import json
conn = get_solr_connection()
my_fq = ["original-format:newspaper", "hassegments:true", 'partof_title:"yellowstone monitor. \(glendive, mont.\) 1905-1928"', 'date:[1911-01-01T00:00:00Z TO 1912-12-31T00:00:00Z]']
res = conn.raw_query(fq=my_fq, wt='json', rows=1000)
c = json.loads(res)['response']['docs']
print len(c)