This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| task importSampleData(type: com.marklogic.gradle.task.MlcpTask) { | |
| def directory = "./sample-dir/" // can get this from gradle properties | |
| //parse csv files | |
| doFirst { | |
| println "\nSTART: Reading files" | |
| def totalLineCount = 0 | |
| fileTree(directory).each{ file -> | |
| def filename = file.getName() | |
| def lineCount = java.nio.file.Files.lines(file.toPath()).count() -1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| echo "Testing if already configured" | |
| ADMIN_STATUS_CODE=`curl -I http://localhost:8001/admin/v1/init 2>/dev/null | head -n 1 | cut -d$' ' -f2` | |
| if [ "$ADMIN_STATUS_CODE" == "401" ]; then | |
| echo "Server is already configured." | |
| exit 0 | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function () { | |
| var i, elements = document.querySelectorAll('body *'); | |
| for (i = 0; i < elements.length; i++) { | |
| if (getComputedStyle(elements[i]).position === 'fixed') { | |
| elements[i].parentNode.removeChild(elements[i]); | |
| } | |
| } | |
| })(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| * Documents | |
| • App-Services | |
| • Modules | |
| • Schemas | |
| • Triggers | |
| • Security | |
| curl --anyauth --user admin:XXXX -H "Content-Type: application/json" -X POST -d '{"forest-name": "Documents-replica-01","host": "myserver-02"}' http://localhost:8002/manage/v2/forests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [global] | |
| directory=${DIRNAME} | |
| thread | |
| fsync=16 | |
| [ML_merging] | |
| blocksize=512k | |
| readwrite=rw | |
| size=5g | |
| ioengine=sync |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import | |
| -host | |
| localhost | |
| -port | |
| 9000 | |
| -username | |
| admin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class CustomDeleteCollectionsTask extends com.marklogic.gradle.task.datamovement.DataMovementTask { | |
| String[] collections | |
| @org.gradle.api.tasks.TaskAction | |
| void deleteCollections() { | |
| project.ext.collections = (collections != null && collections.length > 0) ? collections.join(",") : null | |
| runQueryBatcherJob(new com.marklogic.client.ext.datamovement.job.DeleteCollectionsJob()) | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| find . -name "*.pdf" -o -name "*.jpg" -o -name "*.png" -o -name "*.tif" -o -name "*.PNG" | sed 's| |\\ |g' | xargs ls -sk | sed 's/ .\/.*\//,/g' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| xquery version "1.0-ml"; | |
| (xdmp:list-cache-clear(), | |
| xdmp:expanded-tree-cache-clear(), | |
| xdmp:compressed-tree-cache-clear(), | |
| xdmp:triple-cache-clear(), | |
| xdmp:triple-value-cache-clear(), | |
| xdmp:cache-status(xdmp:host())) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| // Simple way to download the model and insert it into the database. | |
| // Normally would use a tool like mlcp to do this. This only needs to be done once | |
| declareUpdate() | |
| //downloads the BiDAF model | |
| let model = fn.subsequence( | |
| xdmp.httpGet("https://onnxzoo.blob.core.windows.net/models/opset_9/bidaf/bidaf.onnx") | |
| , 2, 1) | |
| //inserts the BiDAF model into the database at the URI /onnx/model/bidaf.onnx |