Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken links in Pipelines docs #133

Merged
merged 2 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/Pipelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Learn how to transform incoming data in an Elasticsearch Ingest Pip

# Ingest Pipelines

Elasticsearch allows you to create pipelines which pre-process inbound documents and data. Methods are available to create, read, update and delete pipelines. For more information on defining processors, conditionals and options see the (PUT Pipeline)[https://www.elastic.co/guide/en/elasticsearch/reference/master/put-pipeline-api.html] and (Processor)[https://www.elastic.co/guide/en/elasticsearch/reference/master/ingest-processors.html] documentation.
Elasticsearch allows you to create pipelines which pre-process inbound documents and data. Methods are available to create, read, update and delete pipelines. For more information on defining processors, conditionals and options see the [PUT Pipeline](https://www.elastic.co/guide/en/elasticsearch/reference/master/put-pipeline-api.html) and [Processor](https://www.elastic.co/guide/en/elasticsearch/reference/master/ingest-processors.html) documentation.


## Creating a Pipeline
Expand Down Expand Up @@ -107,4 +107,4 @@ For multiple documents, the pipeline may be set in the document, prior to the `s
```js
getInstance( "Client@cbElasticsearch" )
.saveAll( documents=myDocuments, params={ "pipeline" : "foo-pipeline" } );
```
```
20 changes: 12 additions & 8 deletions models/SearchBuilder.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,12 @@ component accessors="true" {
* @fields Array or list of fields to pull term vectors on
* @options Any custom parameters to send with the request.
*/
struct function getTermVectors( string id = "", any fields = "", struct options = {} ){
var args = arguments;
struct function getTermVectors(
string id = "",
any fields = "",
struct options = {}
){
var args = arguments;
args.indexName = variables.index;

return getClient().getTermVectors( argumentCollection = args );
Expand All @@ -196,13 +200,13 @@ component accessors="true" {
return this;
}

/**
/**
* Backwards compatible getter for max result size
*
*
* @deprecated
*/
any function getMaxRows(){
return getSize();
return getSize();
}

/**
Expand All @@ -217,13 +221,13 @@ component accessors="true" {
return this;
}

/**
/**
* Backwards compatible getter for start row
*
*
* @deprecated
*/
any function getStartRow(){
return getFrom();
return getFrom();
}

/**
Expand Down
15 changes: 10 additions & 5 deletions models/io/HyperClient.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -538,13 +538,18 @@ component accessors="true" threadSafe singleton {
* @params struct Struct of query parameters to influence the request. For example: `"offsets": false }`
* @options struct Body payload to send. For example: `{ "filter": { "max_num_terms": 3 } }`
*/
struct function getTermVectors( required string indexName, string id = "", any fields = [], struct options = {} ){
struct function getTermVectors(
required string indexName,
string id = "",
any fields = [],
struct options = {}
){
arguments.options[ "fields" ] = arguments.fields;
if ( !isArray( arguments.options["fields"] ) ) {
arguments.options["fields"] = listToArray( arguments.options["fields"] );
if ( !isArray( arguments.options[ "fields" ] ) ) {
arguments.options[ "fields" ] = listToArray( arguments.options[ "fields" ] );
}

var endpoint = [arguments.indexName, "_termvectors" ];
var endpoint = [ arguments.indexName, "_termvectors" ];
if ( arguments.id != "" ) {
endpoint.append( arguments.id );
}
Expand Down Expand Up @@ -1031,7 +1036,7 @@ component accessors="true" threadSafe singleton {
deleteRequest.setQueryParam( param.name, param.value );
} );

var response = deleteRequest.send();
var response = deleteRequest.send();
var deleteResult = response.json();

if ( arguments.throwOnError && structKeyExists( deleteResult, "error" ) ) {
Expand Down
42 changes: 21 additions & 21 deletions models/logging/LogstashAppender.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ component
* Runs on registration
*/
public LogstashAppender function onRegistration() output=false{
try{
try {
ensureDataStream();
variables._dataStreamAssured = true;
} catch( any e ){
} catch ( any e ) {
createObject( "java", "java.lang.System" ).err.println(
"Unable to create data stream. The attempt to communicate with the Elasticsearch server returned: #e.message# - #e.detail#. Your ability to log messages with this appender may be compromised."
);
Expand All @@ -138,11 +138,10 @@ component
* Write an entry into the appender.
*/
public void function logMessage( required any logEvent ) output=false{

if( !variables._dataStreamAssured ){
if ( !variables._dataStreamAssured ) {
this.onRegistration();
// skip out if there was a communication failure
if( !variables._dataStreamAssured ){
if ( !variables._dataStreamAssured ) {
return;
}
}
Expand All @@ -151,8 +150,11 @@ component

try {
var document = newDocument().new( index = getProperty( "dataStream" ), properties = logObj );
if( getProperty( "async" ) ){
variables.asyncManager.newFuture().withTimeout( getProperty( "asyncTimeout" ) ).run( () => document.create() );
if ( getProperty( "async" ) ) {
variables.asyncManager
.newFuture()
.withTimeout( getProperty( "asyncTimeout" ) )
.run( () => document.create() );
} else {
document.create();
}
Expand All @@ -166,12 +168,12 @@ component
extraInfo = { "logData" : logObj, "exception" : e },
category = e.type
);
var appendersMap = application.wirebox.getLogbox().getAppenderRegistry();
var appendersMap = application.wirebox.getLogbox().getAppenderRegistry();
// Log errors out to other appenders besides this one
appendersMap
.keyArray()
.filter( function( key ){
return lcase( key ) != lcase( getName() );
return lCase( key ) != lCase( getName() );
} )
.each( function( appenderName ){
appendersMap[ appenderName ].logMessage( eLogEvent );
Expand Down Expand Up @@ -366,7 +368,9 @@ component
if ( propertyExists( "lifecyclePolicy" ) ) {
policyBuilder.setPhases( getProperty( "lifecyclePolicy" ) );
} else {
policyBuilder.hotPhase( rollover=getProperty( "rolloverSize" ) ).withDeletion( age = getProperty( "retentionDays" ) );
policyBuilder
.hotPhase( rollover = getProperty( "rolloverSize" ) )
.withDeletion( age = getProperty( "retentionDays" ) );
}

policyBuilder.save();
Expand Down Expand Up @@ -407,7 +411,9 @@ component
],
"data_stream" : {},
"priority" : getProperty( "indexTemplatePriority" ),
"_meta" : { "description" : "Index Template for cbElasticsearch Logs ( DataStream: #dataStreamName# )" }
"_meta" : {
"description" : "Index Template for cbElasticsearch Logs ( DataStream: #dataStreamName# )"
}
}
);

Expand Down Expand Up @@ -645,7 +651,7 @@ component
"dynamic_templates" : [
{
"user_info_fields" : {
"path_match" : "user.info.*",
"path_match" : "user.info.*",
"match_mapping_type" : "string",
"mapping" : {
"type" : "text",
Expand Down Expand Up @@ -682,17 +688,11 @@ component
},
"error" : {
"type" : "object",
"properties" : {
"extrainfo" : { "type" : "text" }
}
"properties" : { "extrainfo" : { "type" : "text" } }
},
"message" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword", "ignore_above" : 512
}
}
"fields" : { "keyword" : { "type" : "keyword", "ignore_above" : 512 } }
},
"event" : {
"type" : "object",
Expand All @@ -709,7 +709,7 @@ component
"properties" : {
"signature" : { "type" : "keyword" },
"isSuppressed" : { "type" : "boolean" },
"assignment" : { "type" : "keyword" }
"assignment" : { "type" : "keyword" }
}
}
}
Expand Down