forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Search coordinator uses event.ingested in cluster state to do rewrites (
elastic#110352) (elastic#110782) Min/max range for the event.ingested timestamp field (part of Elastic Common Schema) was added to IndexMetadata in cluster state for searchable snapshots in elastic#106252. This commit modifies the search coordinator to rewrite searches to MatchNone if the query searches a range of event.ingested that, from the min/max range in cluster state, is known to not overlap. This is the same behavior we currently have for the @timestamp field.
- Loading branch information
Showing
12 changed files
with
1,034 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
pr: 110352 | ||
summary: Search coordinator uses `event.ingested` in cluster state to do rewrites | ||
area: Search | ||
type: enhancement | ||
issues: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
server/src/main/java/org/elasticsearch/indices/DateFieldRangeInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
package org.elasticsearch.indices; | ||
|
||
import org.elasticsearch.index.mapper.DateFieldMapper; | ||
import org.elasticsearch.index.shard.IndexLongFieldRange; | ||
|
||
/** | ||
* Data holder of timestamp fields held in cluster state IndexMetadata. | ||
*/ | ||
public final class DateFieldRangeInfo { | ||
|
||
private final DateFieldMapper.DateFieldType timestampFieldType; | ||
private final IndexLongFieldRange timestampRange; | ||
private final DateFieldMapper.DateFieldType eventIngestedFieldType; | ||
private final IndexLongFieldRange eventIngestedRange; | ||
|
||
public DateFieldRangeInfo( | ||
DateFieldMapper.DateFieldType timestampFieldType, | ||
IndexLongFieldRange timestampRange, | ||
DateFieldMapper.DateFieldType eventIngestedFieldType, | ||
IndexLongFieldRange eventIngestedRange | ||
) { | ||
this.timestampFieldType = timestampFieldType; | ||
this.timestampRange = timestampRange; | ||
this.eventIngestedFieldType = eventIngestedFieldType; | ||
this.eventIngestedRange = eventIngestedRange; | ||
} | ||
|
||
public DateFieldMapper.DateFieldType getTimestampFieldType() { | ||
return timestampFieldType; | ||
} | ||
|
||
public IndexLongFieldRange getTimestampRange() { | ||
return timestampRange; | ||
} | ||
|
||
public DateFieldMapper.DateFieldType getEventIngestedFieldType() { | ||
return eventIngestedFieldType; | ||
} | ||
|
||
public IndexLongFieldRange getEventIngestedRange() { | ||
return eventIngestedRange; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.