Term proximity based rankings


(Carlos Chinchilla) #1

Hi there,

I run into a problem and I am hoping you can help me out.

Currently "span_near" queries return desired results if all the "span_terms" exists on the results documents. I wonder if its possible to have an "or" inside the clauses, so if one of the terms doesn't exist it still return documents based on term proximity.

Consider these 2 documents:

  1. the great fox
  2. the black night has come and the great and mighty fox went for dinner

If you query for "the great black fox", ES returns the following:

  1. the black night has come and the great and mighty fox went for dinner
  2. the great fox

I would like 'the great fox' to be ranked higher even thought is missing 'black'.

Thanks!


(system) #2