bring in updates from relayer.
This commit is contained in:
@@ -11,9 +11,12 @@ import (
|
||||
|
||||
"github.com/elastic/go-elasticsearch/v8"
|
||||
"github.com/elastic/go-elasticsearch/v8/esutil"
|
||||
"github.com/fiatjaf/eventstore"
|
||||
"github.com/nbd-wtf/go-nostr"
|
||||
)
|
||||
|
||||
var _ eventstore.Storage = (*ElasticsearchStorage)(nil)
|
||||
|
||||
type IndexedEvent struct {
|
||||
Event nostr.Event `json:"event"`
|
||||
ContentSearch string `json:"content_search"`
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
@@ -73,12 +74,12 @@ func buildDsl(filter nostr.Filter) ([]byte, error) {
|
||||
|
||||
// since
|
||||
if filter.Since != nil {
|
||||
dsl.Must(esquery.Range("event.created_at").Gt(filter.Since))
|
||||
dsl.Must(esquery.Range("event.created_at").Gte(filter.Since))
|
||||
}
|
||||
|
||||
// until
|
||||
if filter.Until != nil {
|
||||
dsl.Must(esquery.Range("event.created_at").Lt(filter.Until))
|
||||
dsl.Must(esquery.Range("event.created_at").Lte(filter.Until))
|
||||
}
|
||||
|
||||
// search
|
||||
|
||||
Reference in New Issue
Block a user