This is a part of a groovy code that I wrote to get term positions:
for (pair in pairs) { // pairs is an array of pairs of terms
def (value1, value2) = pair.tokenize(' ');
def pos_w1;
def pos_w2;
for (pos in _index["data"].get(value1, _POSITIONS)) {
pos_w1 = pos.position;
def score = 0;
// terms: list of tokens
for(term in terms) {
q_term_freq = terms.countBy { it }[term];
term_freq = _index[field][term].tf();
doc_freq = _index[field][term].df();
score += term_freq * doc_freq * q_term_freq;
};
score;
The first one gives an error
"GroovyScriptExecutionException[
def score = 0;
// terms: list of tokens
for(term in terms) {
q_term_freq = terms.countBy { it }[term];
term_freq = _index[field][term].tf();
doc_freq = _index[field][term].df();
score += term_freq * doc_freq * q_term_freq;
};
score;
The first one gives an error
"GroovyScriptExecutionException[
I have this JSON object where I wish to change the scoring function of the
search query:
POST /index/document/_search
{
"query": {
"function_score": {
"query": {"match": {"_all": "fox"}},
"script_score": {
"script": "_score"
}
}
}
}
I want to change the s
t;,
"store": true,
"index": "not_analyzed"
}
}
}
This was the mapping I was using.
On Sunday, January 25, 2015 at 11:42:14 PM UTC-5, David Pilato wrote:
>
> I can't see any ma
I set up an index using those settings :
{
"settings": {
"index": {
"type": "default"
},
"number_of_shards": 1,
"number_of_replicas": 0,
"analysis": {