Storing all term positions in an array?

2015-02-10 Thread Panzer
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;

Issues when running groovy script for "function_score"?

2015-01-27 Thread Panzer
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[

Issues while running Groovy script for "function_score"?

2015-01-27 Thread Panzer
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[

How to use "function_score" mehod to modify the score for a document?

2015-01-26 Thread Panzer
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

Re: Not able to see whether data stemmed or not!

2015-01-26 Thread Panzer
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

Not able to see whether data stemmed or not!

2015-01-25 Thread Panzer
I set up an index using those settings : { "settings": { "index": { "type": "default" }, "number_of_shards": 1, "number_of_replicas": 0, "analysis": {