This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"test":{ | |
"state":"open", | |
"settings":{ | |
"index.analysis.filter.filter_shingle.type":"shingle", | |
"index.number_of_replicas":"0", | |
"index.analysis.filter.filter_shingle.output_unigrams":"true", | |
"index.analysis.analyzer.analyzer_shingle.tokenizer":"standard", | |
"index.analysis.filter.filter_shingle.min_shingle_size":"2", | |
"index.analysis.analyzer.analyzer_shingle.filter.0":"standard", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'vendor/autoload.php'; | |
use Sherlock\Sherlock; | |
function pprint($value) { | |
print_r($value); | |
echo "\r\n"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##Listed in order of operations and the resulting output: | |
## reroute the shards - executed on C1 client node | |
$curl -XPOST 'localhost:9200/_cluster/reroute' -d '{ | |
"commands":[ | |
{ | |
"move":{ | |
"index":"test", | |
"shard":2, | |
"from_node":"J47gdOIwQMq2GTmzzmzJBA", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rootLogger: INFO, console, file, socketappender | |
logger: | |
# log action execution errors for easier debugging | |
action: DEBUG | |
# reduce the logging for aws, too much is logged under the default INFO | |
com.amazonaws: WARN | |
# gateway | |
#gateway: DEBUG | |
#index.gateway: DEBUG |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"settings": { | |
"number_of_shards": 3, | |
"number_of_replicas": 0, | |
"index": { | |
"analysis": { | |
"analyzer": { | |
"analyzer_shingle": { | |
"tokenizer": "standard", | |
"filter": [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
###Changes: | |
-Added "include_in_root" for each nested object. | |
-Removed the "nested" params from the last facet | |
This basically copies the nested doc into the root doc. You then reference the root "inner object" rather than the "nested object" to get the data. Be careful though, this breaks down if you have multiple nested docs that share the same name (e.g. array of nested), since the facet will operate on the entire array instead of individual ones. | |
See this thread for more info: https://groups.google.com/d/topic/elasticsearch/pjoNmosdCPs/discussion | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Create the index with no mapping | |
curl -XPUT localhost:9200/startswith/ | |
#add some data | |
curl -XPOST localhost:9200/startswith/test/ -d '{"title":"river dog"}' | |
curl -XPOST localhost:9200/startswith/test/ -d '{"title":"data"}' | |
curl -XPOST localhost:9200/startswith/test/ -d '{"title":"drive"}' | |
curl -XPOST localhost:9200/startswith/test/ -d '{"title":"drunk"}' | |
curl -XPOST localhost:9200/startswith/test/ -d '{"title":"dzone"}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#create a test index with shingle mapping | |
curl -XPUT localhost:9200/test -d '{ | |
"settings":{ | |
"index":{ | |
"analysis":{ | |
"analyzer":{ | |
"analyzer_shingle":{ | |
"tokenizer":"standard", | |
"filter":["standard", "lowercase", "filter_stop", "filter_shingle"] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"mappings":{ | |
"post":{ | |
"properties":{ | |
"body":{ | |
"fields":{ | |
"body":{ | |
"type":"string", | |
"analyzer":"analyzer_term" | |
}, |
NewerOlder