Skip to content

Instantly share code, notes, and snippets.

@jjaffeux
Forked from cedufca/gist:1265607
Created June 13, 2012 20:01
Show Gist options
  • Save jjaffeux/2926117 to your computer and use it in GitHub Desktop.
Save jjaffeux/2926117 to your computer and use it in GitHub Desktop.
ElasticSearch Negative Boosting
---
:query:
:boosting:
:positive:
:filtered:
:query:
:bool:
:should:
- :text:
:name:
:query: ruby
:boost: 10.0
- :text:
name.partial:
:query: ruby
:boost: 5.0
- :text:
:description:
:query: ruby
:boost: 5.0
- :text:
description.partial:
:query: ruby
:boost: 2.5
- :text:
:address:
:query: ruby
:boost: 5.0
- :text:
address.partial:
:query: ruby
:boost: 2.5
- :text:
:programs:
:query: ruby
:boost: 1.0
- :text:
programs.partial:
:query: ruby
:boost: 0.5
:filter:
:or:
- :missing:
:field: date_time_end
- :range:
:date_time_end:
:from: 2011-10-05 17:29:21
:negative:
:ids:
:values:
- 105
:negative_boost: 50.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment