1

I have an Elasticsearch cluster into which realtime events pour in. What I thought I'd be able to achieve is to show the events as they come in inside a ReactiveList in ReactiveSearch. This is what I roughly have:

class App extends Component {
  render() {
  ...
  return {
    <div>
      <ReactiveBase
        app="my-index"
        url="my-secret-es-cluster"
      >
        ...
        <ReactiveList
          componentId="Results"
          dataField="time"
          sortBy="desc"
          stream
          react={{
            and: ['SensorX', 'SensorY'],
          }}
          onData={(res) => <div>{res.time}: {res.some.field_of_interest}</div>}
        />
      </ReactiveBase>
    </div>
    }
  }
}

Whenever I make a change in one of the sensors (i.e. filters) I can see the changes reflected in the ReactiveList component. However, they don't update whenever the database changes, which I had assumed it would do with stream enabled:

This list can reactively update itself based on changes in other components or changes in the database itself.

Two questions:

  1. Have I misunderstood how this component is supposed to work, or do I need to do something else before I can see updates to the ES cluster reflected automatically in the results?
  2. Is it possible to not load results unless a certain sensor is set/selected (e.g. from a DataSearch component)?
Max Power
  • 952
  • 9
  • 24
  • Couple of things: 1. `stream` prop only works when you are hosting on appbase.io, this is due to the fact that other ES services don't offer it. 2. You can use the `defaultQuery` prop of ReactiveList to load a custom query without needing to set any sensor. – siddharthlatest Oct 29 '18 at 10:53
  • The limitation of the `stream` prop is not apparent from the documentation. – Max Power Oct 31 '18 at 10:08

0 Answers0