I'm currently implementing elasticsearch in my Symfony2 application via the FOQElasticaBundle and so far it's been working great based on boosts applied to various fields of my "Story" entity. Here is the config:
foq_elastica:
clients:
default: { host: localhost, port: 9200 }
indexes:
website:
client: default
types:
story:
mappings:
title: { boost: 8 }
summary: { boost: 5 }
text: { boost: 3 }
author:
persistence:
driver: orm # orm, mongodb, propel are available
model: Acme\Bundle\StoryBundle\Entity\Story
provider:
query_builder_method: createIsActiveQueryBuilder
listener:
service: acme_story.search_index_listener
finder:
However I'd like to also apply a boost based on the "published_at" date of the story, so that a story published yesterday would appear in the results before a story published 6 months ago - even if the older story had a slightly better score (obviously this will need a bit of tweaking). Is this possible?
If anyone could let me know how to achieve this using FOQElasticaBundle that would be great, but otherwise I'd appreciate it if you could let me know how to achieve this directly in elasticsearch so I can try and implement the behaviour myself and contribute to the bundle if needs be.
Thanks.