How to return highlight results in position order?

(Xudong You) #1

I am using highlight feature in our product with following like query:
"highlight": {
"fields": {
"content": {
"fragment_size": 100,
"number_of_fragments": 3
seems the default order of highlight results is based on importance, and I know I can change the order to be sorted by score by adding "order":"score" to my query.

But I would prefer the results is in the order that they appear in a paragraph instead of importance/score, I could not find any other documented options to change the return order.

Is there any way to accomplish it?

(Nik Everett) #2

You can sort by "source" iirc. The experimental highlighter supports a
"top_scoring" option you could experiment with if you want to try it.


(Xudong You) #3

thanks your info!
Just curious, in that documentation I can find all these options?

(Xudong You) #4

I just tried the "source" order, do you mean adding "order":"source" as follows?

"order": "source",

It does not work...

(system) #5