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
Accept 1 / 0 as true/false #26
Comments
In JSON there is a specific type for boolean, its funny that its hard to set it. So, how do you imaging this, as {"explain" : "1"} or {"explain" : 1}? |
well, in dynamic languages that don't have a boolean type (eg Perl), false is
and everything else is true. Typically, we'd pass in 1 and 0 to represent true and false, but users could pass in anything. The one gotcha could be if they pass in 'true' or 'false', which would become "true" or "false", but at least in Perl users would be unlikely to do that. |
Ok, make sense. So, places where I parse the JSON and know what to expect, I can take care of that. But, how to you index a JSON document, are the boolean fields there used, or do you use numbers? |
Hmm, that's an interesting one... Typically, most Perl users would use 1 / 0 (so Int). The module I'm using to encode the JSON provides the facility to represent a real JSON 'true' or 'false' by using \1 or \0 (which actually means "a reference to the scalar value 1") Are you able to convert truthy/falsey values to real boolean values when indexing a field mapped as type: "boolean" ? If so, you may not want to enable it by default, so that users of typed languages don't complain. But allow dynamic languages to pass a flag, perhaps? And I'd put a a big GOTCHA warning in my docs explaining the need to use mappings before indexing. |
I do perform optimization when it comes to boolean fields. People can use 1 and 0, but they will be treated automatically as numbers when not explicitly defined in mapping. Even when explicitly defined in the mappings as boolean, only a boolean type is supported. I will add support for numbers as well. |
Opened #33 for the boolean type in JSON documents indexed. |
Accept also 0 int number to indicate false, and any other number to indicate true (on top of accepting json boolean type), closed by 3f045de. |
elasticsearch 1.2.0 has been released. We need to update from SNAPSHOT to released version. Closes #26. (cherry picked from commit ae3f3c23e3fde3b2327c1b5d759ff27675ecb40c)
Closes #26. (cherry picked from commit 60b7c55)
When listing existing blobs for an azure repository, `path` to look at is incorrectly computed which leads to 404 errors. Closes #26. (cherry picked from commit 656fadc)
We now generate `content_length` field field based on file size. Closes elastic#26.
Miscellaneous fixes/clarifications to log messages that arose in tracking down elastic#26.
) Previously, if the leader is a quorum all by itself then the call to safeAddHeartbeatResponse(localNode) would immediately renew the leader's lease, skipping the call to start() and suppressing sending heartbeats to all the other nodes. This breaks the assertion that, after stabilisation, all other connected nodes are followers, because they become candidates if they do not receive heartbeats. After this change we call start() first so that heartbeats are always sent.
Changed conditions on tasks to just use boolean instead of a string.
* Added bulksize challenge variation * Updated following review * Updated following review
Improve conf to allow for dedicated read and write resource as oppose to a single, unified resource used for both. This allows for different ES indices to be used in the same index, one as a source and the other as a sink. 'es.resource' is still supported and used as a fall back. Higher level abstractions, such as Cascading, Hive and Pig, set the proper property automatically. fix elastic#156 fix elastic#45 fix elastic#26
Has this been intentionally reverted? It seems according to https://www.elastic.co/guide/en/elasticsearch/reference/current/boolean.html and experimentally walking into it, that boolean type doesn't support 0 and 1 anymore. |
…est elastic#26) Terraform: use ElastiCache for redis and refresh dequeue integration Deploy a replicated redis using AWS ElastiCache. Data is encrypted in transit and in rest (note that the native redis-cli does not support TLS connection and must be used with stunnel to connect). Access is locked by security group and a PW that is stored in AWS Secrets Manager. Additional changes: Do not us special characters in redis and postgres passwords - they seem to sometimes break the deployment. Create engageli_instance role so terraform could be run on a clean account. Packer: share AMIs with new Demo and eClub House accounts https://engageli.atlassian.net/browse/MPC-933 Refresh dequeue integration: * Update rc.local to setup media-manager backend correctly * Install only postgres and redis clients on image - they are not needed an may cause confusion * Add sample of stunnel config to connect redis-cli to AWS ElastiCache * Add utility script to connect to postgres * TF and dequeue rc.local updates to support AWS redis * Update instance tags for consistency - all instances will have role and stack name tags. * create new IAM role for dequeue nodes and give them access to the redis secret * Create IAM role allowing recorder to send email * Create s3 bucket for recorder * Set tag param to enable dequeue on engageli node * Add api host FQDN as tag on recorder node Approved-by: Hussain Kader Approved-by: Matan Yemini
rename apache license string to match maven-tools format for apache-2.0
Hiya
When you have boolean parameters, eg { "explain": true }, please could you accept any truthy value (eg 1) as for dynamic languages, the user has to go to great lengths to force a boolean true in JSON
thanks
clint
The text was updated successfully, but these errors were encountered: