prisme-flow
Version:
prisme platform flow engine
57 lines (51 loc) • 2.43 kB
HTML
<!--
Created by prisme.io on 09/06/2017.
@author <a href="mailto:hello@prisme.io">savane vamara</a> (prisme.io)
-->
<script type="text/javascript">
RED.nodes.registerType('elasticsearch exists',{
category: 'storage',
defaults: {
name: {value: ''},
documentId: {value: ''},
documentIndex: {value: ''},
documentType: {value: ''},
server: {value:"", type:"remote-server"}
},
color:'#C0DEED',
inputs:1,
outputs:1,
icon: 'elasticsearch.png',
label: function() {
return this.name || 'elasticsearch doc. exists ?';
}
});
</script>
<script type="text/x-red" data-template-name="elasticsearch exists">
<div class="form-row">
<label for="node-input-name"><i class="icon-bookmark"></i> Name</label>
<input type="text" id="node-input-name">
</div>
<div class="form-row">
<label for="node-input-documentId"><i class="fa fa-key"></i> ID</label>
<input type="text" id="node-input-documentId" />
</div>
<div class="form-row">
<label for="node-input-index"><i class="icon-book"></i> Index</label>
<input type="text" id="node-input-documentIndex" />
</div>
<div class="form-row">
<label for="node-input-documentType"><i class="fa fa-cube"></i> Type</label>
<input type="text" id="node-input-documentType" />
</div>
<div class="form-row">
<label for="node-input-server"><i class="fa fa-plug"></i> Server</label>
<input type="text" id="node-input-server" />
</div>
</script>
<script type="text/x-red" data-help-name="elasticsearch exists">
<p>Returns a boolean indicating whether or not a given document exists by id.</p>
<p>The boolean property <code>msg.exists</code> is added to the message and is emitted out of the node with the original payload.</p>
<p>The id, index and type can be configured in the node, however if left blank, the following should be set in an incoming message:<ul><li><code>msg.documentId</code> - the id of the document</li><li><code>msg.documentIndex</code> - the index to use</li><li><code>msg.documentType</code> - the type to use</li></ul></p>
<p>See the <a href="https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-exists">Elasticsearch documentation</a> for more information.</p>
</script>