You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Wang Guangchen <gu...@gmail.com> on 2009/11/17 09:48:26 UTC

How to enable highlighting when subquery is used

Hi all,

I came across this issue when I was exploring the solr FunctionQuery. Hope
anyone of you can help me on this:

I need to combine the score of a normal key word search with one numeric
field in the index to form a new score. So I use the query() function
provided in the FunctionQuery,
So through the _val_hook. I merge the score of a query() with a field's
numeric value by different ratio. this way i get the correct order of
results as i want.
Following is the sample syntax that i used :
    *
q=_val_:"sum(product(scale(query({!v='tissue'}),0,1),0.5),product(div(1,rord(FW)),0.5))
*

But I realized that the highlight feature will no longer work. I want the
subquery "tissue" to be highlighted in the results too, but it seems that
highlight will not use the subquery.

Is there anyone who happened to meet the same problem before? any
alternative solution?

Thanks in advance.


Regards

GC