Related
I am using the Maps Javascript API and styling it. The map loads fine with no errors and styles all the points of interests except for one. I have not been able to find a way that styles parking lots(paid parking/underground parking/building parking/sports complex parking).
I've used just about every option that is listed in the reference table and am not able to featureType that will make it work. I also used the google map styler to create a custom map style but not one of the feature type options will change the parking lot style.
This is the code that I am using to style the map...
const styles = {
default: [],
hide: [
{
featureType: "all",
elementType: "labels.text.fill",
stylers: [
{
"saturation": 100
},
{
"color": "#999999" /* e944e9 */
},
{
"lightness": 15
}
]
},
{
featureType: "all",
elementType: "labels.text.stroke",
stylers: [
{
"visibility": "on"
},
{
"color": "#000000"
},
{
"lightness": 0
}
]
},
{
featureType: "all",
elementType: "labels.icon",
stylers: [
{
"visibility": "off"
}
]
},
{
featureType: "administrative",
elementType: "geometry.fill",
stylers: [
{
"color": "#260f50"
},
{
"lightness": 0
}
]
},
{
featureType: "poi.park",
elementType: "geometry.fill",
stylers: [
{
"color": "#260f50"
},
{
"lightness": 0
}
]
},
{
featureType: "poi.school",
elementType: "geometry.fill",
stylers: [
{
"color": "#260f50"
},
{
"lightness": 0
}
]
},
{
featureType: "poi.medical",
elementType: "geometry.fill",
stylers: [
{
"color": "#260f50"
},
{
"lightness": 0
}
]
},
{
featureType: "administrative",
elementType: "geometry.stroke",
stylers: [
{
"color": "#260f50"
},
{
"lightness": 10
},
{
"weight": 1.2
}
]
},
{
featureType: "administrative.neighborhood",
elementType: "geometry.stroke",
stylers: [
{
"color": "#260f50"
},
{
"lightness": 100
},
{
"weight": 1.2
}
]
},
{
featureType: "poi.sports_complex",
elementType: "geometry",
stylers: [
{
"color": "#260f50"
},
{
"lightness": 0
}
]
},
{
featureType: "landscape",
elementType: "geometry",
stylers: [
{
"color": "#260f50"
},
{
"lightness": 0
}
]
},
{
featureType: "road.arterial",
elementType: "geometry.fill",
stylers: [
{
"color": "#260f50"
},
{
"lightness": 0
}
]
},
{
featureType: "road.arterial",
elementType: "geometry.stroke",
stylers: [
{
"color": "#260f50"
},
{
"lightness": 0
}
]
},
{
featureType: "poi",
elementType: "geometry",
stylers: [
{
"color": "#220a4b"
},
{
"lightness": 21
}
]
},
{
featureType: "poi",
elementType: "geometry.fill",
stylers: [
{
"color": "#220a4b"
},
{
"lightness": 8
},
{
"weight": 1
}
]
},
{
featureType: "poi",
elementType: "geometry.stroke",
stylers: [
{
"color": "#220a4b"
},
{
"lightness": 8
},
{
"weight": 100
}
]
},
{
featureType: "road.highway",
elementType: "geometry.fill",
stylers: [
{
"color": "#220a4b"
},
{
"lightness": 8
}
]
},
{
featureType: "road.highway",
elementType: "geometry.stroke",
stylers: [
{
"color": "#220a4b"
},
{
"lightness": 8
},
{
"weight": 0.2
}
]
},
{
featureType: "road.arterial",
elementType: "geometry",
stylers: [
{
"color": "#220a4b"
},
{
"lightness": 8
}
]
},
{
featureType: "road.local",
elementType: "geometry",
stylers: [
{
"color": "#220a4b"
},
{
"lightness": 8
}
]
},
{
featureType: "transit",
elementType: "geometry",
stylers: [
{
"color": "#220a4b"
},
{
"lightness": 8
}
]
},
{
featureType: "water",
elementType: "geometry",
stylers: [
{
"color": "#220a4b"
},
{
"lightness": 1
}
]
},
{
featureType: "poi.business",
stylers: [{ "visibility": "off" }],
},
{
featureType: "poi.government",
elementType: "labels.icon",
stylers: [{ "visibility": "off" }],
},
{
featureType: "poi.medical",
elementType: "labels.icon",
stylers: [{ "visibility": "off" }],
},
{
featureType: "poi.place_of_worship",
stylers: [{ "visibility": "off" }],
},
{
featureType: "poi.park",
elementType: "labels.icon",
stylers: [{ "visibility": "off" }],
},
{
featureType: "transit.station.bus",
elementType: "labels.icon",
stylers: [{ "visibility": "on" }],
},
{
featureType: "transit.line",
elementType: "labels.icon",
stylers: [{ "visibility": "off" }],
},
],
There doesn't seem to be a way to target parking for styling (not everything can be targeted directly).
You could try creating a feature request.
Another option would be to query the places service for parking lots in the area and display those with your own custom icons or create your own data for the parking areas you want to display.
proof of concept fiddle
code snippet:
let map;
let infowindow;
function initMap() {
infowindow = new google.maps.InfoWindow();
// Styles a map.
map = new google.maps.Map(document.getElementById("map"), {
center: {
lat: 32.7169289,
lng: -117.1657514
},
zoom: 16,
styles: [{
featureType: "all",
elementType: "labels.text.fill",
stylers: [{
"saturation": 100
},
{
"color": "#999999" /* e944e9 */
},
{
"lightness": 15
}
]
},
{
featureType: "all",
elementType: "labels.text.stroke",
stylers: [{
"visibility": "on"
},
{
"color": "#000000"
},
{
"lightness": 0
}
]
},
{
featureType: "all",
elementType: "labels.icon",
stylers: [{
"visibility": "off"
}]
},
{
featureType: "administrative",
elementType: "geometry.fill",
stylers: [{
"color": "#260f50"
},
{
"lightness": 0
}
]
},
{
featureType: "poi.park",
elementType: "geometry.fill",
stylers: [{
"color": "#260f50"
},
{
"lightness": 0
}
]
},
{
featureType: "poi.school",
elementType: "geometry.fill",
stylers: [{
"color": "#260f50"
},
{
"lightness": 0
}
]
},
{
featureType: "poi.medical",
elementType: "geometry.fill",
stylers: [{
"color": "#260f50"
},
{
"lightness": 0
}
]
},
{
featureType: "administrative",
elementType: "geometry.stroke",
stylers: [{
"color": "#260f50"
},
{
"lightness": 10
},
{
"weight": 1.2
}
]
},
{
featureType: "administrative.neighborhood",
elementType: "geometry.stroke",
stylers: [{
"color": "#260f50"
},
{
"lightness": 100
},
{
"weight": 1.2
}
]
},
{
featureType: "poi.sports_complex",
elementType: "geometry",
stylers: [{
"color": "#260f50"
},
{
"lightness": 0
}
]
},
{
featureType: "landscape",
elementType: "geometry",
stylers: [{
"color": "#260f50"
},
{
"lightness": 0
}
]
},
{
featureType: "road.arterial",
elementType: "geometry.fill",
stylers: [{
"color": "#260f50"
},
{
"lightness": 0
}
]
},
{
featureType: "road.arterial",
elementType: "geometry.stroke",
stylers: [{
"color": "#260f50"
},
{
"lightness": 0
}
]
},
{
featureType: "poi",
elementType: "geometry",
stylers: [{
"color": "#220a4b"
},
{
"lightness": 21
}
]
},
{
featureType: "poi",
elementType: "geometry.fill",
stylers: [{
"color": "#220a4b"
},
{
"lightness": 8
},
{
"weight": 1
}
]
},
{
featureType: "poi",
elementType: "geometry.stroke",
stylers: [{
"color": "#220a4b"
},
{
"lightness": 8
},
{
"weight": 100
}
]
},
{
featureType: "road.highway",
elementType: "geometry.fill",
stylers: [{
"color": "#220a4b"
},
{
"lightness": 8
}
]
},
{
featureType: "road.highway",
elementType: "geometry.stroke",
stylers: [{
"color": "#220a4b"
},
{
"lightness": 8
},
{
"weight": 0.2
}
]
},
{
featureType: "road.arterial",
elementType: "geometry",
stylers: [{
"color": "#220a4b"
},
{
"lightness": 8
}
]
},
{
featureType: "road.local",
elementType: "geometry",
stylers: [{
"color": "#220a4b"
},
{
"lightness": 8
}
]
},
{
featureType: "transit",
elementType: "geometry",
stylers: [{
"color": "#220a4b"
},
{
"lightness": 8
}
]
},
{
featureType: "water",
elementType: "geometry",
stylers: [{
"color": "#220a4b"
},
{
"lightness": 1
}
]
},
{
featureType: "poi.business",
stylers: [{
"visibility": "off"
}],
},
{
featureType: "poi.government",
elementType: "labels.icon",
stylers: [{
"visibility": "off"
}],
},
{
featureType: "poi.medical",
elementType: "labels.icon",
stylers: [{
"visibility": "off"
}],
},
{
featureType: "poi.place_of_worship",
stylers: [{
"visibility": "off"
}],
},
{
featureType: "poi.park",
elementType: "labels.icon",
stylers: [{
"visibility": "off"
}],
},
{
featureType: "transit.station.bus",
elementType: "labels.icon",
stylers: [{
"visibility": "on"
}],
},
{
featureType: "transit.line",
elementType: "labels.icon",
stylers: [{
"visibility": "off"
}],
},
],
});
service = new google.maps.places.PlacesService(map);
var request = {
location: map.getCenter(),
keyword: "parking",
radius: '1000',
type: ['parking']
};
service.nearbySearch(request, callback);
}
function callback(results, status) {
if (status == google.maps.places.PlacesServiceStatus.OK) {
console.log("results=" + results.length + " status=" + status)
for (var i = 0; i < results.length; i++) {
console.log("[" + i + "] name=" + results[i].name + " location=" + results[i].geometry.location.toUrlValue(6));
createMarker(results[i]);
}
}
}
function createMarker(place) {
if (!place.geometry || !place.geometry.location) return;
const marker = new google.maps.Marker({
map,
position: place.geometry.location,
title: place.name,
label: "P"
});
google.maps.event.addListener(marker, "click", () => {
infowindow.setContent(place.name || "");
infowindow.open(map, marker);
});
}
window.initMap = initMap;
#map {
height: 100%;
}
html,
body {
height: 100%;
margin: 0;
padding: 0;
}
<!DOCTYPE html>
<html>
<head>
<title>Styled Maps - Night Mode</title>
<script src="https://polyfill.io/v3/polyfill.min.js?features=default"></script>
<!-- jsFiddle will insert css and js -->
</head>
<body>
<div id="map"></div>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCkUOdZ5y7hMm0yrcCQoCvLwzdM6M8s5qk&callback=initMap&v=weekly&libraries=places" defer></script>
</body>
</html>
I´d like to change a whole row color depending on the value of a row´s field:
POST
https://sheets.googleapis.com/v4/spreadsheets/19D_Ctr5pzfuwfT2XlFDIEVsQv2ezMyShwCm-AAq7KY0:batchUpdate
BODY:
{
"requests": [
{
"addConditionalFormatRule": {
"rule": {
"ranges": [
{
"sheetId": 0
}
],
"booleanRule": {
"condition": {
"type": "TEXT_EQ",
"values": [
{
"userEnteredValue": "ERROR"
}
]
},
"format": {
"backgroundColor": {
"green": 0.2,
"red": 0.8
}
}
}
},
"index": 0
}
}
]
}
With this request, I´m changing the cell, but not thew whole row.
Any help will be greatly appreciated.
Thanks in advance.
This Works:
{
"requests": [
{
"addConditionalFormatRule": {
"rule": {
"ranges": [
{
"sheetId": 0,
"startRowIndex": 0
}
],
"booleanRule": {
"condition": {
"type": "CUSTOM_FORMULA",
"values": [
{
"userEnteredValue": "=$D1=\"ERROR\""
}
]
},
"format": {
"backgroundColor": {
"green": 0.2,
"red": 0.8
}
}
}
},
"index": 0
}
}
]
}
I have a relatively simple process set up in Azure Data Factory to copy, cleanse and process some log files from a chatbot which has been running fine until I recently started getting the following errorCode:
"errorCode": "InvalidTemplate",
"message": "Unable to process expressions for action 'EvaluatefinaliseTSCRPTS': 'The function 'bool' was invoked with a parameter that is not valid. The value cannot be converted to the target type",
"failureType": "UserError",
"target": "finaliseTSCRPTS",
"details": ""
I can't seem to identify the error in the ADF process despite going through the code for my process below:
"name": "SearchBot dailyTranscripts",
"properties": {
"activities": [
{
"name": "MST Validation",
"type": "Validation",
"dependsOn": [],
"userProperties": [],
"typeProperties": {
"dataset": {
"referenceName": "teamsLogs",
"type": "DatasetReference"
},
"timeout": "0.00:00:30",
"sleep": 10,
"childItems": true
}
},
{
"name": "Get MST-TSCRPTS",
"type": "Copy",
"dependsOn": [
{
"activity": "MST Validation",
"dependencyConditions": [
"Succeeded"
]
}
],
"policy": {
"timeout": "7.00:00:00",
"retry": 0,
"retryIntervalInSeconds": 30,
"secureOutput": false,
"secureInput": false
},
"userProperties": [],
"typeProperties": {
"source": {
"type": "JsonSource",
"storeSettings": {
"type": "AzureBlobStorageReadSettings",
"recursive": true,
"wildcardFileName": "*.json",
"enablePartitionDiscovery": false
}
},
"sink": {
"type": "JsonSink",
"storeSettings": {
"type": "AzureBlobStorageWriteSettings",
"copyBehavior": "MergeFiles"
},
"formatSettings": {
"type": "JsonWriteSettings",
"quoteAllText": true
}
},
"enableStaging": false,
"translator": {
"type": "TabularTranslator",
"mappings": [
{
"source": {
"path": "$['type']"
},
"sink": {
"path": "$['type']"
}
},
{
"source": {
"path": "$['timestamp']"
},
"sink": {
"path": "$['timestamp']"
}
},
{
"source": {
"path": "$['id']"
},
"sink": {
"path": "$['id']"
}
},
{
"source": {
"path": "$['channelId']"
},
"sink": {
"path": "$['channelId']"
}
},
{
"source": {
"path": "$['serviceUrl']"
},
"sink": {
"path": "$['serviceUrl']"
}
},
{
"source": {
"path": "$['from']['id']"
},
"sink": {
"path": "$['from']['id']"
}
},
{
"source": {
"path": "$['from']['aadObjectId']"
},
"sink": {
"path": "$['from']['aadObjectId']"
}
},
{
"source": {
"path": "$['from']['role']"
},
"sink": {
"path": "$['from']['role']"
}
},
{
"source": {
"path": "$['from']['name']"
},
"sink": {
"path": "$['from']['name']"
}
},
{
"source": {
"path": "$['conversation']['conversationType']"
},
"sink": {
"path": "$['conversation']['conversationType']"
}
},
{
"source": {
"path": "$['conversation']['tenantId']"
},
"sink": {
"path": "$['conversation']['tenantId']"
}
},
{
"source": {
"path": "$['conversation']['id']"
},
"sink": {
"path": "$['conversation']['id']"
}
},
{
"source": {
"path": "$['recipient']['id']"
},
"sink": {
"path": "$['recipient']['id']"
}
},
{
"source": {
"path": "$['recipient']['name']"
},
"sink": {
"path": "$['recipient']['name']"
}
},
{
"source": {
"path": "$['recipient']['aadObjectId']"
},
"sink": {
"path": "$['recipient']['aadObjectId']"
}
},
{
"source": {
"path": "$['recipient']['role']"
},
"sink": {
"path": "$['recipient']['role']"
}
},
{
"source": {
"path": "$['channelData']['tenant']['id']"
},
"sink": {
"path": "$['channelData']['tenant']['id']"
}
},
{
"source": {
"path": "$['text']"
},
"sink": {
"path": "$['text']"
}
},
{
"source": {
"path": "$['inputHint']"
},
"sink": {
"path": "$['inputHint']"
}
},
{
"source": {
"path": "$['replyToId']"
},
"sink": {
"path": "$['replyToId']"
}
},
{
"source": {
"path": "$['textFormat']"
},
"sink": {
"path": "$['textFormat']"
}
},
{
"source": {
"path": "$['localTimestamp']"
},
"sink": {
"path": "$['localTimestamp']"
}
},
{
"source": {
"path": "$['locale']"
},
"sink": {
"path": "$['locale']"
}
},
{
"source": {
"path": "$['value']"
},
"sink": {
"path": "$['value']"
}
},
{
"source": {
"path": "$['valueType']"
},
"sink": {
"path": "$['valueType']"
}
},
{
"source": {
"path": "$['name']"
},
"sink": {
"path": "$['name']"
}
},
{
"source": {
"path": "$['label']"
},
"sink": {
"path": "$['label']"
}
}
]
}
},
"inputs": [
{
"referenceName": "teamsLogs",
"type": "DatasetReference"
}
],
"outputs": [
{
"referenceName": "transcriptsStaging",
"type": "DatasetReference"
}
]
},
{
"name": "finaliseTSCRPTS",
"type": "IfCondition",
"dependsOn": [
{
"activity": "MST Validation",
"dependencyConditions": [
"Completed"
]
},
{
"activity": "Get MST-TSCRPTS",
"dependencyConditions": [
"Succeeded",
"Skipped"
]
}
],
"userProperties": [],
"typeProperties": {
"expression": {
"value": "activity('MST Validation').output.exists",
"type": "Expression"
},
"ifTrueActivities": [
{
"name": "Combine TSCRPTS",
"type": "Copy",
"dependsOn": [],
"policy": {
"timeout": "7.00:00:00",
"retry": 0,
"retryIntervalInSeconds": 30,
"secureOutput": false,
"secureInput": false
},
"userProperties": [],
"typeProperties": {
"source": {
"type": "JsonSource",
"storeSettings": {
"type": "AzureBlobStorageReadSettings",
"recursive": true,
"wildcardFileName": "*.json",
"enablePartitionDiscovery": false
}
},
"sink": {
"type": "JsonSink",
"storeSettings": {
"type": "AzureBlobStorageWriteSettings",
"copyBehavior": "MergeFiles"
},
"formatSettings": {
"type": "JsonWriteSettings",
"quoteAllText": true
}
},
"enableStaging": false
},
"inputs": [
{
"referenceName": "transcriptsStaging",
"type": "DatasetReference"
}
],
"outputs": [
{
"referenceName": "SearchBotDailyTranscripts",
"type": "DatasetReference",
"parameters": {
"sourceFileName": "#concat(formatDateTime(utcnow(), 'yyyy-MM-dd'),'.json')"
}
}
]
},
{
"name": "Delete Staging",
"type": "Delete",
"dependsOn": [
{
"activity": "Combine TSCRPTS",
"dependencyConditions": [
"Succeeded"
]
}
],
"policy": {
"timeout": "7.00:00:00",
"retry": 0,
"retryIntervalInSeconds": 30,
"secureOutput": false,
"secureInput": false
},
"userProperties": [],
"typeProperties": {
"dataset": {
"referenceName": "transcriptsStaging",
"type": "DatasetReference"
},
"enableLogging": false,
"storeSettings": {
"type": "AzureBlobStorageReadSettings",
"recursive": true
}
}
},
{
"name": "Get monthlyTSCRPTS",
"type": "Copy",
"dependsOn": [
{
"activity": "Combine TSCRPTS",
"dependencyConditions": [
"Succeeded"
]
}
],
"policy": {
"timeout": "7.00:00:00",
"retry": 0,
"retryIntervalInSeconds": 30,
"secureOutput": false,
"secureInput": false
},
"userProperties": [],
"typeProperties": {
"source": {
"type": "JsonSource",
"storeSettings": {
"type": "AzureBlobStorageReadSettings",
"recursive": true
}
},
"sink": {
"type": "JsonSink",
"storeSettings": {
"type": "AzureBlobStorageWriteSettings"
},
"formatSettings": {
"type": "JsonWriteSettings",
"quoteAllText": true
}
},
"enableStaging": false
},
"inputs": [
{
"referenceName": "SearchBotDailyTranscripts",
"type": "DatasetReference",
"parameters": {
"sourceFileName": "#concat('2019-',formatDateTime(utcnow(), 'MM'),'-??.json')"
}
}
],
"outputs": [
{
"referenceName": "SearchBotMonthlyTranscripts",
"type": "DatasetReference",
"parameters": {
"sourceFileName": "#dataset().sourceFileName"
}
}
]
},
{
"name": "Get yearlyTSCRPTS",
"type": "Copy",
"dependsOn": [
{
"activity": "Get monthlyTSCRPTS",
"dependencyConditions": [
"Succeeded"
]
}
],
"policy": {
"timeout": "7.00:00:00",
"retry": 0,
"retryIntervalInSeconds": 30,
"secureOutput": false,
"secureInput": false
},
"userProperties": [],
"typeProperties": {
"source": {
"type": "JsonSource",
"storeSettings": {
"type": "AzureBlobStorageReadSettings",
"recursive": true
}
},
"sink": {
"type": "JsonSink",
"storeSettings": {
"type": "AzureBlobStorageWriteSettings",
"copyBehavior": "MergeFiles"
},
"formatSettings": {
"type": "JsonWriteSettings",
"quoteAllText": true
}
},
"enableStaging": false
},
"inputs": [
{
"referenceName": "SearchBotMonthlyTranscripts",
"type": "DatasetReference",
"parameters": {
"sourceFileName": {
"value": "#concat(formatDateTime(utcnow(), 'yyyy'),'-??.json')",
"type": "Expression"
}
}
}
],
"outputs": [
{
"referenceName": "SearchBotYearlyTranscripts",
"type": "DatasetReference",
"parameters": {
"sourceFileName": "#dataset().sourceFileName"
}
}
]
},
{
"name": "Copy MST-TSCRPTS",
"type": "Copy",
"dependsOn": [
{
"activity": "Delete Staging",
"dependencyConditions": [
"Succeeded"
]
}
],
"policy": {
"timeout": "0.00:01:00",
"retry": 0,
"retryIntervalInSeconds": 30,
"secureOutput": false,
"secureInput": false
},
"userProperties": [],
"typeProperties": {
"source": {
"type": "JsonSource",
"storeSettings": {
"type": "AzureBlobStorageReadSettings",
"recursive": true,
"wildcardFileName": "*.json",
"enablePartitionDiscovery": false
}
},
"sink": {
"type": "JsonSink",
"storeSettings": {
"type": "AzureBlobStorageWriteSettings",
"copyBehavior": "MergeFiles"
},
"formatSettings": {
"type": "JsonWriteSettings",
"quoteAllText": true
}
},
"enableStaging": false
},
"inputs": [
{
"referenceName": "teamsLogs",
"type": "DatasetReference"
}
],
"outputs": [
{
"referenceName": "transcriptsHistory",
"type": "DatasetReference"
}
]
},
{
"name": "Delete MST-TSCRPTS",
"type": "Delete",
"dependsOn": [
{
"activity": "Copy MST-TSCRPTS",
"dependencyConditions": [
"Succeeded",
"Failed"
]
}
],
"policy": {
"timeout": "7.00:00:00",
"retry": 0,
"retryIntervalInSeconds": 30,
"secureOutput": false,
"secureInput": false
},
"userProperties": [],
"typeProperties": {
"dataset": {
"referenceName": "teamsLogs",
"type": "DatasetReference"
},
"enableLogging": false,
"storeSettings": {
"type": "AzureBlobStorageReadSettings",
"recursive": true
}
}
},
{
"name": "run learningList",
"type": "ExecutePipeline",
"dependsOn": [
{
"activity": "Delete MST-TSCRPTS",
"dependencyConditions": [
"Succeeded",
"Failed",
"Skipped"
]
}
],
"userProperties": [],
"typeProperties": {
"pipeline": {
"referenceName": "runLearningList",
"type": "PipelineReference"
},
"waitOnCompletion": true
}
}
]
}
}
],
"parameters": {
"sourceFileName": {
"type": "string",
"defaultValue": "#concat(formatDateTime(utcnow(),'yyyy-MM-dd'),'.json')"
}
},
"annotations": []
},
"type": "Microsoft.DataFactory/factories/pipelines"
There is no expression 'EvaluatefinaliseTSCRPTS' and I can't find a 'bool' function either. The only hint I've found was a previous question here
You have an IF activity named "finaliseTSCRPTS", so "EvaluatefinaliseTSCRPTS" is most likely the internal name of the function that performs the IF condition check. The message seems to indicate that it cannot evaluate your expression "activity('MST Validation').output.exists".
I'm just reading through the more advanced validators in the Schema definition of the Swagger specification:
{
"Schema":{
"type":"object",
"properties":{
"title":{
"type":"string"
},
"multipleOf":{
"type":"number",
"minimum":0,
"exclusiveMinimum":true
},
"maximum":{
"type":"number"
},
"exclusiveMaximum":{
"type":"boolean",
"default":false
},
"minimum":{
"type":"number"
},
"exclusiveMinimum":{
"type":"boolean",
"default":false
},
"maxLength":{
"type":"integer",
"minimum":0
},
"minLength":{
"type":"integer",
"minimum":0,
"default":0
},
"pattern":{
"type":"string",
"format":"regex"
},
"maxItems":{
"type":"integer",
"minimum":0
},
"minItems":{
"type":"integer",
"minimum":0,
"default":0
},
"uniqueItems":{
"type":"boolean",
"default":false
},
"maxProperties":{
"type":"integer",
"minimum":0
},
"minProperties":{
"type":"integer",
"minimum":0,
"default":0
},
"required":{
"type":"array",
"items":{
"type":"string"
},
"minItems":1,
"uniqueItems":true
},
"enum":{
"type":"array",
"items":{
},
"minItems":1,
"uniqueItems":true
},
"type":{
"type":"string",
"enum":[
"array",
"boolean",
"integer",
"number",
"object",
"string"
]
},
"not":{
"oneOf":[
{
"$ref":"#/definitions/Schema"
},
{
"$ref":"#/definitions/Reference"
}
]
},
"allOf":{
"type":"array",
"items":{
"oneOf":[
{
"$ref":"#/definitions/Schema"
},
{
"$ref":"#/definitions/Reference"
}
]
}
},
"oneOf":{
"type":"array",
"items":{
"oneOf":[
{
"$ref":"#/definitions/Schema"
},
{
"$ref":"#/definitions/Reference"
}
]
}
},
"anyOf":{
"type":"array",
"items":{
"oneOf":[
{
"$ref":"#/definitions/Schema"
},
{
"$ref":"#/definitions/Reference"
}
]
}
},
"items":{
"oneOf":[
{
"$ref":"#/definitions/Schema"
},
{
"$ref":"#/definitions/Reference"
}
]
},
"properties":{
"type":"object",
"additionalProperties":{
"oneOf":[
{
"$ref":"#/definitions/Schema"
},
{
"$ref":"#/definitions/Reference"
}
]
}
},
"additionalProperties":{
"oneOf":[
{
"$ref":"#/definitions/Schema"
},
{
"$ref":"#/definitions/Reference"
},
{
"type":"boolean"
}
],
"default":true
},
"description":{
"type":"string"
},
"format":{
"type":"string"
},
"default":{
},
"nullable":{
"type":"boolean",
"default":false
},
"discriminator":{
"$ref":"#/definitions/Discriminator"
},
"readOnly":{
"type":"boolean",
"default":false
},
"writeOnly":{
"type":"boolean",
"default":false
},
"example":{
},
"externalDocs":{
"$ref":"#/definitions/ExternalDocumentation"
},
"deprecated":{
"type":"boolean",
"default":false
},
"xml":{
"$ref":"#/definitions/XML"
}
},
"patternProperties":{
"^x-":{
}
},
"additionalProperties":false
}
}
The thing that I am thinking about is combinations of the anyOf, allOf, oneOf and not keywords. I have two questions.
The first question is: "can they be used in conjunction"? Like so:
{
"allOf" : [
{
"minItems" : 0
},
{
"maxItems" : 10
}
],
"anyOf" : [
{
"type" : "array",
"items" : {
"type" : "string"
}
},
{
"type" : "array",
"items" : {
"type" : "integer"
}
}
]
}
This example is, of course, needlessly complicated. But is it valid? Or can you only use one modifier but not the others?
The second question is, can anybody point me to a real-world example where one of these operators have been used in conjunction?
The thing that I am thinking about is combinations of the anyOf, allOf, oneOf and not keywords. I have two questions.
The first question is: "can they be used in conjunction"?
Yes, allOf, anyOf, oneOf and not can be used in conjunction. OpenAPI Specification follows the rules of JSON Schema here, and in JSON Schema adjacent keywords work as branches of an implicit allOf (source). So your example is equivalent to:
{
"allOf": [
{
"allOf": [
{
"minItems": 0
},
{
"maxItems": 10
}
]
},
{
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "array",
"items": {
"type": "integer"
}
}
]
}
]
}
That said, this example is too complex and can be simplified into:
{
"minItems": 0,
"maxItems": 10,
"type": "array",
"items": {
"oneOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
}
}
I have created an elasticsearch index. It searches everything correctly but when any new document is added it does not index it automatically. Everytime I have to restart the service for it to index the new document.
PUT /_river/mydocum1/_meta
{
"type": "fs",
"fs": {
"url": "\\\\file\\datum\\Depart\\Inet\\",
"update_rate": 3600,
"includes": [
"*.docx",
"*.xlsx",
"*.pdf",
"*.txt",
"*.doc",
"*.xls"
]
},
"index": {
"index": "test",
"type": "docum",
"bulk_size": 500
}
}
EDIT:
Here are the settings
{
"test": {
"settings": {
"index": {
"uuid": "9rofjAZySByrtehnjemkjudg",
"analysis": {
"filter": {
"synonym_filter": {
"type": "synonym",
"synonyms_path": "analysis/main_synonym.txt"
},
"nGram_filter": {
"max_gram": "20",
"min_gram": "2",
"type": "nGram",
"token_chars": [
"letter",
"digit",
"punctuation",
"symbol"
]
}
},
"analyzer": {
"search_analyzer_2": {
"type": "custom",
"filter": [
"lowercase",
"asciifolding",
"synonym_filter"
],
"tokenizer": "standard"
},
"index_analyzer": {
"type": "custom",
"filter": [
"lowercase",
"asciifolding",
"nGram_filter"
],
"tokenizer": "whitespace"
},
"search_analyzer": {
"type": "custom",
"filter": [
"lowercase",
"asciifolding",
"synonym_filter"
],
"tokenizer": "whitespace"
},
"index_analyzer_2": {
"type": "custom",
"filter": [
"lowercase",
"asciifolding"
],
"tokenizer": "whitespace"
},
"index_analyzer_3": {
"type": "custom",
"filter": [
"lowercase",
"asciifolding"
],
"tokenizer": "standard"
},
"nGram_analyzer": {
"type": "custom",
"filter": [
"lowercase",
"asciifolding",
"nGram_filter"
],
"tokenizer": "whitespace"
},
"index_analyzer_4": {
"type": "custom",
"filter": [
"lowercase",
"asciifolding"
],
"tokenizer": "keyword"
},
"whitespace_analyzer": {
"type": "custom",
"filter": [
"lowercase",
"asciifolding"
],
"tokenizer": "whitespace"
}
}
}
}
}
Does anyone know how do I solve it?