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

Accept 1 / 0 as true/false #26

Closed
clintongormley opened this issue Feb 18, 2010 · 8 comments
Closed

Accept 1 / 0 as true/false #26

clintongormley opened this issue Feb 18, 2010 · 8 comments

Comments

@clintongormley
Copy link

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

@kimchy
Copy link
Member

kimchy commented Feb 18, 2010

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}?

@clintongormley
Copy link
Author

well, in dynamic languages that don't have a boolean type (eg Perl), false is

  • 0
  • undef / null
  • ""
  • "0"

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.

@kimchy
Copy link
Member

kimchy commented Feb 19, 2010

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?

@clintongormley
Copy link
Author

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.

@kimchy
Copy link
Member

kimchy commented Feb 19, 2010

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.

@kimchy
Copy link
Member

kimchy commented Feb 19, 2010

Opened #33 for the boolean type in JSON documents indexed.

@kimchy
Copy link
Member

kimchy commented Feb 20, 2010

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.

spinscale added a commit that referenced this issue Jun 5, 2015
dadoonet added a commit that referenced this issue Jun 5, 2015
With #2784, we can now add plugin version in `es-plugin.properties` file.

It will only be used with elasticsearch 1.0.0 and upper. No need to push it in 1.x branch.

Closes #26.
dadoonet added a commit that referenced this issue Jun 5, 2015
elasticsearch 1.2.0 has been released. We need to update from SNAPSHOT to released version.

Closes #26.

(cherry picked from commit ae3f3c23e3fde3b2327c1b5d759ff27675ecb40c)
dadoonet added a commit that referenced this issue Jun 5, 2015
Closes #26.

(cherry picked from commit 60b7c55)
dadoonet added a commit that referenced this issue Jun 5, 2015
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)
dadoonet pushed a commit that referenced this issue Jun 5, 2015
dadoonet added a commit that referenced this issue Jun 5, 2015
dadoonet added a commit that referenced this issue Jun 9, 2015
rmuir pushed a commit to rmuir/elasticsearch that referenced this issue Nov 8, 2015
We now generate `content_length` field field based on file size.
Closes elastic#26.
ywelsch pushed a commit to ywelsch/elasticsearch that referenced this issue Apr 24, 2018
Miscellaneous fixes/clarifications to log messages that arose
in tracking down elastic#26.
ywelsch pushed a commit to ywelsch/elasticsearch that referenced this issue Apr 24, 2018
)

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.
ClaudioMFreitas pushed a commit to ClaudioMFreitas/elasticsearch-1 that referenced this issue Nov 12, 2019
Changed conditions on tasks to just use boolean instead of a string.
henningandersen pushed a commit to henningandersen/elasticsearch that referenced this issue Jun 4, 2020
* Added bulksize challenge variation

* Updated following review

* Updated following review
williamrandolph pushed a commit to williamrandolph/elasticsearch that referenced this issue Jun 4, 2020
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
@JoranDox
Copy link

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.

mindw pushed a commit to mindw/elasticsearch that referenced this issue Sep 5, 2022
…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
mindw pushed a commit to mindw/elasticsearch that referenced this issue Sep 5, 2022
emilykmarx pushed a commit to emilykmarx/elasticsearch that referenced this issue Dec 26, 2023
rename apache license string to match maven-tools format for apache-2.0
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants