Created
January 26, 2017 18:13
-
-
Save jaohaohsuan/f85c7f325ceed0be80a167cbf0bdf550 to your computer and use it in GitHub Desktop.
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
| val lines = """|PUT my_index | |
| |{ | |
| | "mappings": { | |
| | "my_type": { | |
| | "properties": { | |
| | "location": { | |
| | "type": "geo_point" | |
| | } | |
| | } | |
| | } | |
| | } | |
| |}""".stripMargin | |
| // mtach first line as HttpRequest | |
| val r = """^(.*)""".r | |
| val Some(cmd) = r.findFirstIn(lines) | |
| // cmd: String = PUT my_index | |
| val body = lines.substring(lines.indexOf('\n')+1); | |
| // body: String = | |
| // { | |
| // "mappings": { | |
| // "my_type": { | |
| // "properties": { | |
| // "location": { | |
| // "type": "geo_point" | |
| // } | |
| // } | |
| // } | |
| // } | |
| // } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment