Skip to content

Instantly share code, notes, and snippets.

View imotov's full-sized avatar

Igor Motov imotov

View GitHub Profile
@imotov
imotov / stop-words-test.log
Created April 11, 2012 16:10 — forked from kwloafman/stop-words-test.log
Stop Words in Quoted vs Unquoted Search
{"ok":true,"acknowledged":true}
{"ok":true,"acknowledged":true}
{"ok":true,"_index":"test","_type":"content","_id":"1","_version":1}
{"ok":true,"_index":"test","_type":"content","_id":"2","_version":1}
{"ok":true,"_shards":{"total":10,"successful":5,"failed":0}}
{
"took" : 7,
"timed_out" : false,
"_shards" : {
"total" : 5,
curl -XDELETE http://localhost:9200/twitter
curl -XPUT http://localhost:9200/twitter -d '{
"settings" : {
"index" : {
"number_of_shards" : 1,
"number_of_replicas" : 1
}
},
"mappings" : {
"tweet" : {
# Delete all pins
curl -X DELETE "http://localhost:9200/pins"
echo
curl -XPUT 'http://localhost:9200/pins'
echo
# Create proper mapping
curl -XPUT 'http://localhost:9200/pins/pin/_mapping' -d '
{
"pin" : {
"properties" : {
#!/bin/bash
curl -XDELETE http://localhost:9200/test-orders
curl -XPUT http://localhost:9200/test-orders -d '{
"mappings" : {
"copy_order_snapshot": {
"properties": {
"line_item_info": {
"dynamic": "true",
"properties": {
"m_product_details": {
@imotov
imotov / script-source-demo.sh
Created July 3, 2012 15:42
Script source demo
curl -XDELETE http://localhost:9200/test-index
echo
curl -XPUT http://localhost:9200/test-index -d '{
"settings" : {
"index" : {
"number_of_shards" : 1,
"number_of_replicas" : 0
}
},
"mappings" : {
curl -XDELETE 'http://localhost:9200/windowz'
echo
curl -XPUT 'http://localhost:9200/windowz' -d '{
"mappings" : {
"message" : {
"properties" : {
"title" : {
"type" : "string",
"search_analyzer" : "str_search_analyzer",
@imotov
imotov / document.xml
Created August 7, 2012 00:22
Solr 3.6.1 highlighting
<add><doc>
<field name="id">1</field>
<field name="message">foo and bar and something else</field>
</doc></add>
@imotov
imotov / demo.sh
Created August 7, 2012 00:46
elasticsearch 0.20.0.Beta1-SNAPSHOT highlighting
#!/bin/sh
curl -XDELETE http://localhost:9200/test-idx && echo
curl -XPUT http://localhost:9200/test-idx -d '{
"settings" : {
"index" : {
"number_of_shards" : 1,
"number_of_replicas" : 0,
"analysis": {
"analyzer" : {
"standard_no_pos" : {
@imotov
imotov / doubleid.sh
Created August 10, 2012 01:17
Repro for double id problem
#!/bin/sh
curl -XDELETE "http://localhost:9200/test"
curl -XPUT "http://localhost:9200/test" -d '{
"mappings" : {
"rec" : {
"_id" : {"store" : "yes"}
}
}
}'
curl -XPUT "http://localhost:9200/test/rec/1" -d '{
#!/bin/sh
# Delete old version to make sure new settings are applied
curl -XDELETE "localhost:9200/prefix-test/"
echo
# Create a new index with custom path_hierarchy analyzer
# See http://www.elasticsearch.org/guide/reference/index-modules/analysis/pathhierarchy-tokenizer.html
curl -XPUT "localhost:9200/prefix-test" -d '{
"settings": {
"analysis": {
"analyzer": {