elasticsearch


How can I get a decay function to work withn the query for elastic search?


I am using elastic search to build a simple search engine.
One piece I am trying to nail down is that I want to be able to have more recently released documents get pushed closer to the top of the search results and so I am using an "exp" decay function (gaussian). I clearly am missing something because it is not working as I expected it to. I have fiddled with the number to no avail.
The goal is to take this one query (with nothing but the formula in it) and make it return with our more recent documents near the top of the results. Literally, there are no other pieces to this query. I have included the "explain" portion of the top result for information.
Please help! I don't get it....
{
"query": {
"function_score": {
"exp": {
"createdAt": {
"origin": "now",
"scale": "30d",
"decay": 0.8,
"offset": "7d"
}
}
}
}
}
The first result has this value
"createdAt": "2007-12-07T11:54:04.000Z",
We have documents that are from 2017 - the top few articles are from 2007!
I don't understand what is wrong...
"_explanation": {
"value": 1,
"description": "function score, product of:",
"details": [
{
"value": 1,
"description": "*:*, product of:",
"details": [
{
"value": 1,
"description": "boost",
"details": []
},
{
"value": 1,
"description": "queryNorm",
"details": []
}
]
},
{
"value": 1,
"description": "min of:",
"details": [
{
"value": 1,
"description": "Function for field createdAt:",
"details": [
{
"value": 1,
"description": "exp(- MIN[0.0] * 8.608933306875375E-11)",
"details": []
}
]
},
{
"value": 3.4028235e+38,
"description": "maxBoost",
"details": []
}
]
}
]
}
},

Related Links

Find all ID where ID are not in my blacklist
How to order results by custom value and then by _score
Kibana homepage shows blank after deleting all indices
elasticsearch: update in a nested object (HTTP)
Using Phoenix to help to integrate elastic-search and Hbase. When use sqlline.py,to create table, bad happens
Shards and replicas elastic search
Elasticsearch Completion Suggester - Sort suggestions
Can _score from different queries be compared?
Difference between a “plain” terms query and a terms query using a filter
Elasticsearch: Updating a field that has been set as a document _id via mapping with a path
Return parent data with child document from Elasticsearch
Elasticsearch Giving Incorrect Result When Using “must_not” operator alongwith “must” Operator
ElasticSearch _suggest queries are case sensitive. Want them to be case insensitive
How to normalize periods in elastic search query (such that JJ Abrams == J.J Abrams)?
Elastic Search - Sort By Doc Type
ElasticSearch Filtering aggregations from array field

Categories

HOME
automapper
website
vue-resource
ontology
sentry
joomla3.2
static-analysis
timber
eddystone
twitter-oauth
xamarin-zebble
locationmanager
tomcat8
node-webkit
pst
uislider
animated-gif
nurbs
window-managers
beego
npoi
ibm-connections
xenapp
toad
delayed-job
directfb
java-stream
busboy
nsuserdefaults
jslint
ms-solver-foundation
reset
best-buy-api
netapp
google-prediction
apache-toree
nothing
cordova-ios
pecl
cefpython
deviare
e
clp
verisign
wif4.5
ioexception
helm
textpattern
godeps
msgpack
smart-tv
nastran
ambiguity
calcite
apple
compositetype
alwayson
ampersand
shoes
debug-symbols
cakephp-2.2
cout
xhprof
redpitaya
wso2bam
cpu-time
django-sites
jmenubar
eclim
vlab
grails-2.3
mute
hints
statechart
dibs
arel
dojo-1.9
email-verification
daap
nsmutablestring
instance-variables
wndproc
thejit
gamesalad
prefuse
navigationcontroller
sigar
glx
differentiation
delphi-prism
mediacontroller
upshot
jmenu
mygeneration
chunking
multiple-users
aggregator
getimagesize
browser-based
wmd-editor
database-cloning
ning
datagridcolumn
server-load
watchpoint
service-factory

Resources

Encrypt Message