# Trying to boost by date

**URL:** <https://discuss.elastic.co/t/trying-to-boost-by-date/12389>\
**Category:** Elasticsearch\
**Created:** [June 12, 2013, 5:29pm UTC](https://discuss.elastic.co/t/trying-to-boost-by-date/12389 "2013-06-12T17:29:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nick\_Verwymeren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nick_verwymeren/32/2281_2.png) [@Nick\_Verwymeren](https://discuss.elastic.co/u/Nick_Verwymeren)\
**Post date:** [June 12, 2013, 5:29pm UTC](https://discuss.elastic.co/t/trying-to-boost-by-date/12389/1 "2013-06-12T17:29:01Z")

</div>

I'm trying to boost my articles based on the post\_date field in the index.  
I've followed along this tutorial[http://jontai.me/blog/2013/01/advanced-scoring-in-elasticsearch/](http://jontai.me/blog/2013/01/advanced-scoring-in-elasticsearch/)as best I could but I'm running into some issues. When I execute the following  
curl [https://gist.github.com/greatwitenorth/144507f760bbe3a311a6](https://gist.github.com/greatwitenorth/144507f760bbe3a311a6) it gives  
me this error:  
nested: QueryParsingException[[spna] [custom\_filters\_score] query does not  
support [query]];

So I thought, OK I'll remove query from custom\_filters\_score but when I do  
that I get this error:  
nested: QueryParsingException[[spna] [custom\_filters\_score] requires  
'query' field];

I'm not really sue what to do here. I'm guessing it's a formatting error in  
my curl statement. But these error messages are kind of contradicting each  
other.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Nick\_Verwymeren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nick_verwymeren/32/2281_2.png) [@Nick\_Verwymeren](https://discuss.elastic.co/u/Nick_Verwymeren)\
**Post date:** [June 12, 2013, 6:12pm UTC](https://discuss.elastic.co/t/trying-to-boost-by-date/12389/2 "2013-06-12T18:12:24Z")

</div>

OK I think I found my syntax error. I've passed in a query\_string into  
query. But now the issue is with the script. I'm getting an error:  
"error" : "CompileException[[Error: No field found for  
[org.elasticsearch.index.fielddata.ScriptDocValues$Longs@359abca] in  
mapping with types [post]]\n[Near : {... \*pow(10,-11)) \* abs(now -  
doc[post\_date].date.getM ....}]\n ^\n[Line:  
1, Column: 35]]; nested: ElasticSearchIllegalArgumentException[No field  
found for [org.elasticsearch.index.fielddata.ScriptDocValues$Longs@359abca]  
in mapping with types [post]]; ",

Here is the curl I'm using now:

> <https://gist.github.com/greatwitenorth/1bf70694e451bda9817d>

Here is the mappings for the index:  
{  
"spna" : {  
"post" : {  
"properties" : {  
"category" : {  
"type" : "string"  
},  
"post\_author" : {  
"type" : "string"  
},  
"post\_content" : {  
"type" : "string"  
},  
"post\_date" : {  
"type" : "date",  
"format" : "YYYY-MM-dd HH:mm:ss"  
},  
"post\_tag" : {  
"type" : "string"  
},  
"post\_title" : {  
"type" : "string"  
}  
}  
},  
"page" : {  
"properties" : {  
"post\_author" : {  
"type" : "string"  
},  
"post\_content" : {  
"type" : "string"  
},  
"post\_date" : {  
"type" : "date",  
"format" : "YYYY-MM-dd HH:mm:ss"  
},  
"post\_title" : {  
"type" : "string"  
}  
}  
}  
}  
}

On Wednesday, June 12, 2013 12:29:01 PM UTC-5, Nick Verwymeren wrote:

> I'm trying to boost my articles based on the post\_date field in the index.  
> I've followed along this tutorial[http://jontai.me/blog/2013/01/advanced-scoring-in-elasticsearch/](http://jontai.me/blog/2013/01/advanced-scoring-in-elasticsearch/)as best I could but I'm running into some issues. When I execute the following  
> curl [https://gist.github.com/greatwitenorth/144507f760bbe3a311a6](https://gist.github.com/greatwitenorth/144507f760bbe3a311a6) it  
> gives me this error:  
> nested: QueryParsingException[[spna] [custom\_filters\_score] query does not  
> support [query]];
> 
> So I thought, OK I'll remove query from custom\_filters\_score but when I do  
> that I get this error:  
> nested: QueryParsingException[[spna] [custom\_filters\_score] requires  
> 'query' field];
> 
> I'm not really sue what to do here. I'm guessing it's a formatting error  
> in my curl statement. But these error messages are kind  
> of contradicting each other.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:31am UTC](https://discuss.elastic.co/t/trying-to-boost-by-date/12389/3 "2017-07-06T02:31:31Z")

</div>


