How to get query term vectors using scripts?


(jasonz) #1

I'm using scripts to implement some custom score function like:

∑is_ge_1(_index['FIELD']['TERM'].tf()) / my_query.termvectors('ANALYZER').size()
where TERM is one of my_query.termvectors(), and FIELD can be passed from script params.

I'm able to get _index['FIELD']['TERM'].tf() according to the docs.

But how can I get the whole query term vectors just like _analyzer API?
I've googled this before but didn't get something useful. Only lucene v3.5 has QueryTermVector API.
Or if there's some other better approaches to implement this?

Thank you in advance.


(system) #2

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.