Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

{
"query" : {
"filtered" : {
"query" : {
"custom_score" : {
"query" : {
"nested" : {
"path" : "path1",
"query" : {
"flt" : {
@cdolivares
cdolivares / gist:1202096
Created September 7, 2011 23:14
Custom Script Query
"query" : {
"filtered" : {
"query" : {
"custom_score" : {
"query" : {
"nested" : {
"path" : "expertises", "query" : {
"flt" : {
"fields" : ["expertises.subject_name"], "like_text : args[0]
}
[2011-09-07 16:52:50,340][DEBUG][action.search.type ] [Nate Grey] [36] Failed to execute fetch phase
java.lang.IllegalArgumentException
at java.nio.Buffer.limit(Buffer.java:249)
at org.apache.lucene.store.NIOFSDirectory$NIOFSIndexInput.readInternal(NIOFSDirectory.java:123)
at org.apache.lucene.store.BufferedIndexInput.refill(BufferedIndexInput.java:213)
at org.apache.lucene.store.BufferedIndexInput.readByte(BufferedIndexInput.java:39)
at org.apache.lucene.store.DataInput.readInt(DataInput.java:84)
at org.apache.lucene.store.BufferedIndexInput.readInt(BufferedIndexInput.java:153)
at org.apache.lucene.store.DataInput.readLong(DataInput.java:126)
at org.apache.lucene.store.BufferedIndexInput.readLong(BufferedIndexInput.java:166)
tp_hash = param1['properties'];
vouches = _source.vouches;
a = 0;
b = 0;
c = 0;
d = 0;
e = 0;
f = 0;
{
"thistype" : {
"_routing" : {
"required" : true
},
"properties" : {
"open_requests" : {
"type" : "long"
}
},
curl -XPUT 'http://localhost:9200/testings/' -d '{
"index" : {
"number_of_shards" : 1
}
}'
curl -XPUT 'http://localhost:9200/testings/testing/_mapping' -d '{
"testing" : {
"properties" : {
Parent document mapping
{
"parent" : {
"properties" : {
"headline" : {
"type" : "string"
},
"doc_score" : {
"type" : "long"
a = 5
b = 10
c = 9
#using nested function
callback = (b,c) ->
return (err, doc) ->
console.log "B and C are available here"
#connectDb.coffee
module.exports = (mongoString) ->
mongoose = require 'mongoose'
db = mongoose.createConnection mongoString
return db
#dbConfig.coffee
module.exports = (mongoInstance) ->
models = {}
app.get "/api/*", routes.proxy.get
routes.proxy.get = (req, res) ->
qIndex = req.url.indexOf("?")
queryString = req.url.substr(qIndex)
options =
host: 127.0.0.1
path: req.path + queryString
port: 8000
headers: req.headers