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
package nachiket.trial; | |
import org.elasticsearch.action.search.SearchResponse; | |
import org.elasticsearch.client.Client; | |
import org.elasticsearch.client.transport.TransportClient; | |
import org.elasticsearch.common.transport.InetSocketTransportAddress; | |
import org.elasticsearch.index.query.BoolQueryBuilder; | |
import org.elasticsearch.index.query.CustomScoreQueryBuilder; | |
import org.elasticsearch.index.query.QueryBuilders; |
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
[INFO] Scanning for projects... | |
[INFO] | |
[INFO] ------------------------------------------------------------------------ | |
[INFO] Building uploader 1.0 | |
[INFO] ------------------------------------------------------------------------ | |
Downloading: http://192.168.1.5/artifactory/ext-snapshot-local/org/elasticsearch/elasticsearch/0.16.2/elasticsearch-0.16.2.pom | |
Downloading: http://192.168.1.5/artifactory/ext-snapshot-local/org/elasticsearch/elasticsearch/0.16.2/elasticsearch-0.16.2.pom | |
[INFO] ------------------------------------------------------------------------ | |
[INFO] BUILD FAILURE | |
[INFO] ------------------------------------------------------------------------ |
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
package mypackage; | |
import org.elasticsearch.index.query.xcontent.BoolQueryBuilder; | |
import org.elasticsearch.index.query.xcontent.CustomScoreQueryBuilder; | |
import org.elasticsearch.index.query.xcontent.QueryBuilders; | |
public class Tryout { | |
public static void main(String args[]) throws UnknownHostException, MongoException |
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
org.elasticsearch.search.SearchParseException: [twitter][0]: from[-1],size[-1]: Parse Failure [Failed to parse source [{ | |
"query": | |
{ | |
"custom_score": | |
{ | |
"query":{"match_all":{}}, | |
"lang" : "native" , "script" : "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 -XPUT localhost:9200/test/doc/1 -d ' | |
{ | |
"user" : 2, | |
"name" :2 | |
}' | |
{"ok":true,"_index":"test","_type":"doc","_id":"1","_version":1} | |
curl -XPUT localhost:9200/test/doc/2 -d ' | |
{ | |
"name": 1 | |
}' |
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 -XPUT localhost:9200/twitter/script/1 -d ' | |
{ | |
"user" : "kimchy" , | |
"location" : { "lat" : 20.32 , "lon" : 23.23 } | |
}' | |
{"ok":true,"_index":"twitter","_type":"script","_id":"1","_version":3} | |
curl -XGET 'localhost:9200/twitter/script/_search?pretty=true' -d ' | |
{ | |
"query": |
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 -XPUT 'localhost:9200/twitter/script/1' -d ' | |
{ | |
"location": | |
{ | |
"lat": 10, | |
"lon": 10 | |
} | |
}' | |
{"ok":true,"_index":"twitter","_type":"script","_id":"1","_version":2} |
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 -XPOST localhost:9200/twitter/script -d '{"user" : 1}' | |
{"ok":true,"_index":"twitter","_type":"script","_id":"QdNvKdECReqKmJXz5XhJFw","_version":1} | |
curl -XGET 'http://127.0.0.1:9200/twitter/script/_search?pretty=1' -d ' | |
{ | |
"query" : { | |
"custom_score" : { | |
"script" : "_doc[\u0027user\u0027]", | |
"query" : { | |
"match_all" : {} |
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 -XPOST localhost:9200/twitter/script -d '{"user" : 1}' | |
{"ok":true,"_index":"twitter","_type":"script","_id":"QdNvKdECReqKmJXz5XhJFw","_version":1} | |
curl -XGET 'localhost:9200/twitter/script/_search?pretty=true' -d ' | |
{ | |
"query": | |
{ | |
"custom_score": | |
{ | |
"query":{"match_all":{}}, |