Last active
December 22, 2015 14:09
-
-
Save altfatterz/6483918 to your computer and use it in GitHub Desktop.
percolate request
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
// create a source of the percolate request | |
XContentBuilder docBuilder = jsonBuilder() | |
.startObject() | |
.field("doc") | |
.startObject() | |
.startObject("location") | |
.field("lat", 52.10) | |
.field("lon", 5.12) | |
.endObject() | |
.field("price", 290000) | |
.endObject() | |
.endObject(); | |
// send the percolate request | |
PercolateResponse response = client.preparePercolate() | |
.setIndices("households") | |
.setDocumentType("household") | |
.setSource(docBuilder) | |
.execute().actionGet(); | |
assertThat(response.getCount(), is(1L)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment