Skip to content

Commit

Permalink
add time index
Browse files Browse the repository at this point in the history
  • Loading branch information
hengfeiyang committed May 21, 2022
1 parent 4983dac commit bacc2f8
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pkg/core/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ package core

import (
"context"
"encoding/binary"
"fmt"
"math"
"path/filepath"
Expand Down Expand Up @@ -132,9 +131,7 @@ func (index *Index) BuildBlugeDocumentFromJSON(docID string, doc map[string]inte
bdoc.AddField(bluge.NewCompositeFieldExcluding("_all", []string{"_index", "_id", "_source", "@timestamp"}))

// test for add time index
buf := make([]byte, binary.MaxVarintLen64)
bufN := binary.PutUvarint(buf, uint64(timestamp.UnixNano()))
bdoc.AddField(bluge.NewStoredOnlyField("_timestamp", buf[:bufN]))
bdoc.SetTimestamp(timestamp.UnixNano())

return bdoc, nil
}
Expand Down

0 comments on commit bacc2f8

Please sign in to comment.