Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
jclausen committed Jul 27, 2023
2 parents 8ecf449 + 439dfb0 commit 853e84d
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 37 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@ jobs:
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
cfengine: [ "lucee@5", "adobe@2018", "adobe@2021" ]
ELASTICSEARCH_VERSION: [ "7.17.8", "8.7.0" ]
cfengine: [ "lucee@5", "adobe@2018", "adobe@2021", "adobe@2023" ]
coldboxVersion: [ "^6", "^7" ]
ELASTICSEARCH_VERSION: [ "7.17.10", "8.8.1" ]
experimental: [ false ]
include:
- cfengine: "adobe@2023"
ELASTICSEARCH_VERSION: "8.7.0"
- cfengine: "lucee@6"
coldboxVersion: "^7"
ELASTICSEARCH_VERSION: "8.8.1"
experimental: true
steps:
- name: Checkout Repository
Expand Down
2 changes: 1 addition & 1 deletion box.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name":"Elasticsearch for the Coldbox Framework",
"author":"Ortus Solutions <[email protected]",
"location":"https://downloads.ortussolutions.com/ortussolutions/coldbox-modules/cbelasticsearch/@build.version@/[email protected]@[email protected]@.zip",
"version":"3.2.1",
"version":"3.2.2",
"slug":"cbelasticsearch",
"type":"modules",
"homepage":"https://cbelasticsearch.ortusbooks.com",
Expand Down
5 changes: 3 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

----
## [Unreleased]

## [3.2.2] - 07-27-2023
## Fixed
* Corrected incorrect timestamps on LogstashAppender logs
## [3.2.1] - 06-20-2023
### Fixed
* Corrected a typing error when performing error handling in `deleteById()`
Expand Down
4 changes: 2 additions & 2 deletions docs/Documents.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var book = getInstance( "Document@cbElasticsearch" ).new(
"lastName" = "Clausen"
},
// date with specific format type
"publishDate" = dateTimeFormat( now(), "yyyy-mm-dd'T'hh:nn:ssZZ" ),
"publishDate" = dateTimeFormat( now(), "yyyy-mm-dd'T'HH:nn:ssZZ" ),
"edition" = 1,
"ISBN" = 123456789054321
}
Expand Down Expand Up @@ -193,7 +193,7 @@ var ops = [
"lastName" = "Clausen"
},
// date with specific format type
"publishDate" = dateTimeFormat( now(), "yyyy-mm-dd'T'hh:nn:ssZZ" ),
"publishDate" = dateTimeFormat( now(), "yyyy-mm-dd'T'HH:nn:ssZZ" ),
"edition" = 1,
"ISBN" = 123456789054321
},
Expand Down
4 changes: 2 additions & 2 deletions models/logging/LogstashAppender.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,15 @@ component
var tzInfo = getTimezoneInfo();

var logObj = {
"@timestamp" : dateTimeFormat( loge.getTimestamp(), "yyyy-mm-dd'T'hh:nn:ssZZ" ),
"@timestamp" : dateTimeFormat( loge.getTimestamp(), "yyyy-mm-dd'T'HH:nn:ssZZ" ),
"log" : {
"level" : level,
"logger" : getName(),
"category" : loggerCat
},
"message" : message,
"event" : {
"created" : dateTimeFormat( loge.getTimestamp(), "yyyy-mm-dd'T'hh:nn:ssZZ" ),
"created" : dateTimeFormat( loge.getTimestamp(), "yyyy-mm-dd'T'HH:nn:ssZZ" ),
"severity" : loge.getSeverity(),
"category" : loggerCat,
"dataset" : "cfml",
Expand Down
2 changes: 1 addition & 1 deletion models/util/Util.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ component accessors="true" singleton {

void function preflightLogEntry( required struct logObj ){
if ( !arguments.logObj.keyExists( "@timestamp" ) ) {
arguments.logObj[ "@timestamp" ] = dateTimeFormat( now(), "yyyy-mm-dd'T'hh:nn:ssZZ" )
arguments.logObj[ "@timestamp" ] = dateTimeFormat( now(), "yyyy-mm-dd'T'HH:nn:ssZZ" )
}

// ensure consistent casing for search
Expand Down
21 changes: 21 additions & 0 deletions [email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name":"cbelasticsearch-lucee@6",
"app":{
"serverHomeDirectory":".engine/lucee6",
"cfengine":"lucee@6"
},
"web":{
"http":{
"port":"60299"
},
"rewrites":{
"enable":"true"
},
"webroot":"test-harness",
"aliases":{
"/moduleroot/cbelasticsearch":"./",
"/root":"./test-harness"
}
},
"openBrowser":"false"
}
6 changes: 3 additions & 3 deletions test-harness/tests/specs/unit/DocumentTest.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ component extends="coldbox.system.testing.BaseTestCase" {
var testDocument = {
"_id" : createUUID(),
"title" : "My Test Document",
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'hh:nn:ssZZ" )
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'HH:nn:ssZZ" )
};

var created = variables.model
Expand Down Expand Up @@ -89,7 +89,7 @@ component extends="coldbox.system.testing.BaseTestCase" {
var testDocument = {
"_id" : createUUID(),
"title" : "My Test Document",
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'hh:nn:ssZZ" )
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'HH:nn:ssZZ" )
};

var created = variables.model
Expand All @@ -116,7 +116,7 @@ component extends="coldbox.system.testing.BaseTestCase" {
var testDocument = {
"_id" : "id with spaces",
"title" : "My Test Document",
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'hh:nn:ssZZ" )
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'HH:nn:ssZZ" )
};

var created = variables.model
Expand Down
34 changes: 17 additions & 17 deletions test-harness/tests/specs/unit/HyperClientTest.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ component extends="coldbox.system.testing.BaseTestCase" {
var testDocument = {
"_id" : createUUID(),
"title" : "My Test Document",
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'hh:nn:ssZZ" )
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'HH:nn:ssZZ" )
};

var document = getWirebox()
Expand All @@ -197,7 +197,7 @@ component extends="coldbox.system.testing.BaseTestCase" {
var testDocument = {
"_id" : createUUID(),
"title" : "My Test Document",
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'hh:nn:ssZZ" )
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'HH:nn:ssZZ" )
};

var document = getWirebox()
Expand Down Expand Up @@ -260,7 +260,7 @@ component extends="coldbox.system.testing.BaseTestCase" {
var bulkDoc = {
"_id" : createUUID(),
"title" : "Test Bulk Insert Document Number #i#",
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'hh:nn:ssZZ" )
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'HH:nn:ssZZ" )
};

docs.append( bulkDoc );
Expand Down Expand Up @@ -335,7 +335,7 @@ component extends="coldbox.system.testing.BaseTestCase" {
var bulkDoc = {
"_id" : createUUID(),
"title" : "Test Document Number #i#",
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'hh:nn:ssZZ" )
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'HH:nn:ssZZ" )
};

arrayAppend(
Expand Down Expand Up @@ -369,7 +369,7 @@ component extends="coldbox.system.testing.BaseTestCase" {
var bulkDoc = {
"_id" : createUUID(),
"title" : "Test Document Number #i#",
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'hh:nn:ssZZ" )
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'HH:nn:ssZZ" )
};

arrayAppend(
Expand Down Expand Up @@ -410,7 +410,7 @@ component extends="coldbox.system.testing.BaseTestCase" {
var bulkDoc = {
"_id" : createUUID(),
"title" : "Test Document Number #i#",
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'hh:nn:ssZZ" )
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'HH:nn:ssZZ" )
};

arrayAppend(
Expand Down Expand Up @@ -634,7 +634,7 @@ component extends="coldbox.system.testing.BaseTestCase" {
"testdocs", {
"_id" : createUUID(),
"title" : "My Test Document",
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'hh:nn:ssZZ" ),
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'HH:nn:ssZZ" ),
"price" : 9.99
} )
.save( refresh = true );
Expand Down Expand Up @@ -681,7 +681,7 @@ component extends="coldbox.system.testing.BaseTestCase" {
{
"_id" : createUUID(),
"title" : "My Test Document",
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'hh:nn:ssZZ" ),
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'HH:nn:ssZZ" ),
"price" : 9.99
} )
.save( refresh = true );
Expand Down Expand Up @@ -795,7 +795,7 @@ component extends="coldbox.system.testing.BaseTestCase" {
var testDocument = {
"_id" : createUUID(),
"title" : "My Test Document for deletion",
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'hh:nn:ssZZ" )
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'HH:nn:ssZZ" )
};

var document = getWirebox()
Expand Down Expand Up @@ -826,7 +826,7 @@ component extends="coldbox.system.testing.BaseTestCase" {
var testDocument = {
"_id" : createUUID(),
"title" : "My Test Document",
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'hh:nn:ssZZ" )
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'HH:nn:ssZZ" )
};

var document = getWirebox()
Expand Down Expand Up @@ -862,7 +862,7 @@ component extends="coldbox.system.testing.BaseTestCase" {
var testDocument = {
"_id" : createUUID(),
"title" : "My Async Test Document",
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'hh:nn:ssZZ" )
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'HH:nn:ssZZ" )
};

var document = getWirebox()
Expand Down Expand Up @@ -897,7 +897,7 @@ component extends="coldbox.system.testing.BaseTestCase" {
var testDocument = {
"_id" : createUUID(),
"title" : "My Test Document",
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'hh:nn:ssZZ" )
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'HH:nn:ssZZ" )
};

var document = getWirebox()
Expand Down Expand Up @@ -947,7 +947,7 @@ component extends="coldbox.system.testing.BaseTestCase" {
var testDocument = {
"_id" : createUUID(),
"title" : "My Test Document",
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'hh:nn:ssZZ" )
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'HH:nn:ssZZ" )
};

var document = getWirebox()
Expand Down Expand Up @@ -1015,7 +1015,7 @@ component extends="coldbox.system.testing.BaseTestCase" {
var testDocument = {
"_id" : createUUID(),
"title" : "My Test Document",
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'hh:nn:ssZZ" )
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'HH:nn:ssZZ" )
};

var document = getWirebox()
Expand Down Expand Up @@ -1128,7 +1128,7 @@ debug( result );
{
"_id" : createUUID(),
"title" : "Test Document Number #i#",
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'hh:nn:ssZZ" )
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'HH:nn:ssZZ" )
}
)
);
Expand Down Expand Up @@ -1201,7 +1201,7 @@ debug( result );
"_id" : createUUID(),
"title" : "Test Document Number #i#",
"flag" : i % 2 == 0 ? "flag" : "noflag",
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'hh:nn:ssZZ" )
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'HH:nn:ssZZ" )
}
)
);
Expand Down Expand Up @@ -1271,7 +1271,7 @@ debug( result );
var bulkDoc = {
"_id" : createUUID(),
"title" : "Test Document Number #i#",
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'hh:nn:ssZZ" ),
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'HH:nn:ssZZ" ),
"description" : "Document Number #i# of 10,000"
};

Expand Down
10 changes: 5 additions & 5 deletions test-harness/tests/specs/unit/SearchBuilderTest.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ component extends="coldbox.system.testing.BaseTestCase" {

it( "Tests the dateMatch() method", function(){
var searchBuilder = variables.model.new( variables.testIndexName, "testdocs" );
var dateStart = dateTimeFormat( now(), "yyyy-mm-dd'T'hh:nn:ssXXX" );
var dateEnd = dateTimeFormat( now(), "yyyy-mm-dd'T'hh:nn:ssXXX" );
var dateStart = dateTimeFormat( now(), "yyyy-mm-dd'T'HH:nn:ssXXX" );
var dateEnd = dateTimeFormat( now(), "yyyy-mm-dd'T'HH:nn:ssXXX" );
searchBuilder.dateMatch( "createdTime", dateStart, dateEnd, 2 );

expect( searchBuilder.getQuery() ).toBeStruct().toHaveKey( "bool" );
Expand All @@ -274,8 +274,8 @@ component extends="coldbox.system.testing.BaseTestCase" {
} );
it( "Tests the filterRange() method", function(){
var searchBuilder = variables.model.new( variables.testIndexName, "testdocs" );
var dateStart = dateTimeFormat( now(), "yyyy-mm-dd'T'hh:nn:ssXXX" );
var dateEnd = dateTimeFormat( now(), "yyyy-mm-dd'T'hh:nn:ssXXX" );
var dateStart = dateTimeFormat( now(), "yyyy-mm-dd'T'HH:nn:ssXXX" );
var dateEnd = dateTimeFormat( now(), "yyyy-mm-dd'T'HH:nn:ssXXX" );
searchBuilder.filterRange( "createdTime", dateStart, dateEnd );

expect( searchBuilder.getQuery() ).toBeStruct().toHaveKey( "bool" );
Expand Down Expand Up @@ -1280,7 +1280,7 @@ component extends="coldbox.system.testing.BaseTestCase" {
var testDocument = {
"_id" : createUUID(),
"title" : "My Test Document",
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'hh:nn:ssZZ" )
"createdTime" : dateTimeFormat( now(), "yyyy-mm-dd'T'HH:nn:ssZZ" )
};

var document = getWirebox()
Expand Down

0 comments on commit 853e84d

Please sign in to comment.