This file contains 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
{ | |
"query": { | |
"function_score": { | |
"query": { | |
"multi_match": { | |
"query": "gospel", | |
"fields": [ | |
"title.raw^60", | |
"authors.raw^40", | |
"subjects.raw^20", |
This file contains 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
{ | |
"size": 100, | |
"query": { | |
"filtered": { | |
"query": { | |
"multi_match": { | |
"query": "gospel", | |
"fields": [ | |
"title.raw^60", | |
"authors.raw^40", |
This file contains 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
#!/bin/sh | |
echo | |
echo '===========================' | |
echo 'Creating an empty index' | |
echo '===========================' | |
curl -XDELETE localhost:9200/test | |
curl -XPOST localhost:9200/test/ -d '{"settings": {"index.number_of_shards": 1}}' | |
echo |
This file contains 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
{ | |
"title": "another test application", | |
"services": { | |
"query": { | |
"idQueue": [ | |
2, | |
3, | |
4 | |
], | |
"list": { |
This file contains 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
curl -XDELETE localhost:9200/test | |
curl -XPUT localhost:9200/test -d '{ | |
"settings": { | |
"number_of_shards": 1 | |
} | |
}' | |
curl -XPUT localhost:9200/test/test/1 -d '{ | |
"tags": "foo" | |
}' | |
curl -XPUT localhost:9200/test/test/2 -d '{ |
This file contains 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
curl -XDELETE localhost:9200/test1 | |
curl -XPUT localhost:9200/test1 | |
curl -XPUT localhost:9200/test1/test/_mapping -d '{ | |
"test": { | |
"properties": { | |
"foo": { | |
"type": "string", | |
"index": "not_analyzed" | |
} | |
} |
This file contains 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
#!/bin/bash | |
curl -XDELETE localhost:9200/test | |
curl -XPUT localhost:9200/test | |
curl -XPUT localhost:9200/test/test/_mapping -d '{ | |
"test": { | |
"_id": { | |
"path": "foo" | |
} | |
} |
This file contains 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
curl -XDELETE localhost:9200/test | |
curl -XPUT localhost:9200/test/test/1 -d '{"foo": "bar"}' | |
curl -XPOST localhost:9200/test/_refresh | |
echo | |
echo "===============" | |
echo -e "\e[00;32mCORRECT: SCORE IS SHOWN WHEN SORTING ON SCORE\e[00m" | |
echo "===============" | |
curl 'localhost:9200/test/test/_search?q=bar&pretty' 2>/dev/null | grep score | |
echo | |
echo "===============" |
This file contains 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
curl -XDELETE localhost:9200/test/ | |
curl -XPUT localhost:9200/test/ | |
curl -XPUT localhost:9200/test/son/_mapping -d '{ | |
"son": { | |
"_parent": { | |
"type": "mother" | |
} | |
} | |
}' | |
curl -XPUT localhost:9200/test/daughter/_mapping -d '{ |
This file contains 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
curl -XDELETE localhost:9200/test1/ | |
curl -XDELETE localhost:9200/test2/ | |
curl -XPUT localhost:9200/test1/ | |
curl -XPUT localhost:9200/test1/source_includes/_mapping -d '{ | |
"source_includes": { | |
"_source": { | |
"includes": [ "included" ] | |
} | |
} | |
}' |