Skip to content

Painless: Single-Quoted Strings#18150

Closed
jdconrad wants to merge 4 commits intoelastic:masterfrom
jdconrad:strings
Closed

Painless: Single-Quoted Strings#18150
jdconrad wants to merge 4 commits intoelastic:masterfrom
jdconrad:strings

Conversation

@jdconrad
Copy link
Copy Markdown
Contributor

@jdconrad jdconrad commented May 5, 2016

Added single-quoted strings to Painless + tests.
Added String -> char and char -> String casting.
Fixed a minor bug related to statically-typed shortcuts in lists.

@jdconrad jdconrad added :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache :Plugin Lang Painless v5.0.0-alpha3 labels May 5, 2016
@rmuir
Copy link
Copy Markdown
Contributor

rmuir commented May 5, 2016

I'll review it. This should be a huge win.

Today we don't support doc['field'], leaving only doc["field"] and doc.field. We document/recommend doc.field only because double quote escaping such as doc[\"field\"] is hellacious. But doc.field is much slower.

Being able to support doc['field'] gives us consistency with the script engines today, and it gives a 50% performance increase (we gave it more type information, removes dynamic lookup).

public static String charToString(final char value) {
return "" + value;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@rmuir
Copy link
Copy Markdown
Contributor

rmuir commented May 5, 2016

Looks good. I pushed a commit with some docs and tests changes and ran benchmarks.

@jdconrad jdconrad closed this in 2cae575 May 5, 2016
@jdconrad
Copy link
Copy Markdown
Contributor Author

jdconrad commented May 5, 2016

Used merge --squash. This made it into master.

@jdconrad jdconrad mentioned this pull request May 5, 2016
18 tasks
@jdconrad jdconrad deleted the strings branch June 7, 2016 23:17
@clintongormley clintongormley added :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache and removed :Plugin Lang Painless labels Feb 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Core/Infra/Scripting Scripting abstractions, Painless, and Mustache das awesome >enhancement v5.0.0-alpha3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants