Skip to content

Instantly share code, notes, and snippets.

@evanwong
evanwong / BuildConfig.groovy
Last active August 29, 2015 14:08
Upgrade Grails from 2.3 to 2.4
grails.servlet.version = "3.0" // Change depending on target container compliance (2.5 or 3.0)
grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
grails.project.work.dir = "target/work"
grails.project.target.level = 1.7
grails.project.source.level = 1.7
//grails.project.war.file = "target/${appName}-${appVersion}.war"
grails.project.fork = [
Starting Go Server with command: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.55.x86_64/bin/java -server -Xms512m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=256m -Duser.language=en -Dorg.mortbay.jetty.Request.maxFormContentSize=30000000 -Djruby.rack.request.size.threshold.bytes=30000000 -Duser.country=US -Dcruise.config.dir=/etc/go -Dcruise.config.file=/etc/go/cruise-config.xml -Dcruise.server.port=8153 -Dcruise.server.ssl.port=8154 -jar /usr/share/go-server/go.jar
Starting Go Server in directory:
2014-05-21 12:54:35,598 INFO [main] GoSslSocketConnector:61 - Using SSL socket selector SslSelectChannelConnector (NIO) with maxIdleTime=30000
2014-05-21 12:54:35,762 INFO [main] GoServer:132 - Configuring Jetty using /etc/go/jetty.xml
2014-05-21 12:54:38,936 INFO [main] H2Database:123 - [db] Using connection configuration jdbc:h2:db/h2db/cruise;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE;MVCC=FALSE;CACHE_SIZE=131072;TRACE_LEVEL_FILE=1;TRACE_MAX_FILE_SIZE=16;DATABASE_EVENT_LISTENER='com.thoughtworks.go.server.util.H2
@evanwong
evanwong / elasticsearch.yml
Created February 26, 2014 15:58
elasticsearch.yml with defined analysis
##################### Elasticsearch Configuration Example #####################
# This file contains an overview of various configuration settings,
# targeted at operations staff. Application developers should
# consult the guide at <http://elasticsearch.org/guide>.
#
# The installation procedure is covered at
# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/setup.html>.
#
# Elasticsearch comes with reasonable defaults for most settings,
@evanwong
evanwong / _explain
Created September 20, 2013 14:26
elasticsearch _score not matching explanation.value
curl -XGET localhost:9200/test/title/1/_explain -d '{
"query": {
"multi_match": {
"query": "matching",
"fields": [
"_all"
]
}
}
}'
@evanwong
evanwong / elasticsearch java completion suggest
Created September 10, 2013 15:46
elasticsearch java client to query a completion suggest v0.90.3
String clusterName = "testcluster";
String indexName = "textindex";
String suggestionName = "suggestion";
NodeBuilder nodeBuilder = NodeBuilder.nodeBuilder().clusterName(clusterName).client(true);
Node node = nodeBuilder.node();
try {
Client client = node.client();
CompletionSuggestionBuilder completionSuggestionBuilder = new CompletionSuggestionBuilder(suggestionName);
SuggestResponse suggestionRes = client.prepareSuggest(indexName).setSuggestText("tes").addSuggestion(completionSuggestionBuilder.field("suggest")).execute().actionGet();
Suggest suggest = suggestionRes.getSuggest();
@evanwong
evanwong / elasticsearch ngram analyzer
Created September 10, 2013 15:30
example for defining a global analyzer in the elasticsearch.yml v0.90.3
index.analysis.analyzer.ngramAnalyzer :
tokenizer : ngramTokenizer
filter : [standard, lowercase, stop]
index.analysis.tokenizer.ngramAnalyzer :
type : nGram
min_gram: 3
max_gram: 10
token_chars: [letter, digit]