Filtering by shard

Hello,

I'm trying to resolve a major challenge with ElasticSearch : I have
documents published since few years, and i'm adding new documents every
day. But some of documents indexed can't be returned to the client before a
specified date. But this constraint is only for the docs published during
the last 15 days max. I dont want to run a query on the entire index to
check if documents match this constraint but i would like to be able to
filter results by shards : actually i'm routing my docs during indexing
based on creation date. Since it's just a boolean filter, i understand that
it's not altering the score. Is there a way to filter only on a specific
shard or specific index, so i can run it only on documents from the last 15
days ?

Thanks a lot.

Loïc

--

I cannot think of a way to do it by shard. But if you can create a new
index every 15 days, you can use indiceshttp://www.elasticsearch.org/guide/reference/query-dsl/indices-query.htmlquery to add filter for only the last two indices. You can also use filtered
aliaseshttp://www.elasticsearch.org/guide/reference/api/admin-indices-aliases.htmlto hide all this complexity from elasticsearch callers.

On Thursday, November 1, 2012 10:29:35 AM UTC-4, Loïc Bertron wrote:

Hello,

I'm trying to resolve a major challenge with Elasticsearch : I have
documents published since few years, and i'm adding new documents every
day. But some of documents indexed can't be returned to the client before a
specified date. But this constraint is only for the docs published during
the last 15 days max. I dont want to run a query on the entire index to
check if documents match this constraint but i would like to be able to
filter results by shards : actually i'm routing my docs during indexing
based on creation date. Since it's just a boolean filter, i understand that
it's not altering the score. Is there a way to filter only on a specific
shard or specific index, so i can run it only on documents from the last 15
days ?

Thanks a lot.

Loïc

--

Thanks a lot Igor.

Le jeudi 1 novembre 2012 10:49:31 UTC-4, Igor Motov a écrit :

I cannot think of a way to do it by shard. But if you can create a new
index every 15 days, you can use indiceshttp://www.elasticsearch.org/guide/reference/query-dsl/indices-query.htmlquery to add filter for only the last two indices. You can also use filtered
aliaseshttp://www.elasticsearch.org/guide/reference/api/admin-indices-aliases.htmlto hide all this complexity from elasticsearch callers.

On Thursday, November 1, 2012 10:29:35 AM UTC-4, Loïc Bertron wrote:

Hello,

I'm trying to resolve a major challenge with Elasticsearch : I have
documents published since few years, and i'm adding new documents every
day. But some of documents indexed can't be returned to the client before a
specified date. But this constraint is only for the docs published during
the last 15 days max. I dont want to run a query on the entire index to
check if documents match this constraint but i would like to be able to
filter results by shards : actually i'm routing my docs during indexing
based on creation date. Since it's just a boolean filter, i understand that
it's not altering the score. Is there a way to filter only on a specific
shard or specific index, so i can run it only on documents from the last 15
days ?

Thanks a lot.

Loïc

--