Package org.elasticsearch.search.fetch.source

Examples of org.elasticsearch.search.fetch.source.FetchSourceContext.includes()


                case "1" :
                    assertThat(fetchSource.fetchSource(), is(false));
                    break;
                case "2" :
                    assertThat(fetchSource.fetchSource(), is(true));
                    assertThat(fetchSource.includes(), is(new String[]{"field3", "field4"}));
                    break;
                case "3" :
                    assertThat(fetchSource.fetchSource(), is(true));
                    assertThat(fetchSource.includes(), is(new String[]{"user"}));
                    assertThat(fetchSource.excludes(), is(new String[]{"user.location"}));
View Full Code Here


                    assertThat(fetchSource.fetchSource(), is(true));
                    assertThat(fetchSource.includes(), is(new String[]{"field3", "field4"}));
                    break;
                case "3" :
                    assertThat(fetchSource.fetchSource(), is(true));
                    assertThat(fetchSource.includes(), is(new String[]{"user"}));
                    assertThat(fetchSource.excludes(), is(new String[]{"user.location"}));
                    break;
                default:
                    fail("item with id: " + item.id() + " is not 1, 2 or 3");
                    break;
View Full Code Here

        if (context == null) {
            request.fetchSourceContext(new FetchSourceContext(includes, excludes));
        }
        else {
            context.fetchSource(true);
            context.includes(includes);
            context.excludes(excludes);
        }
        return this;
    }
View Full Code Here

            if (this.routing() != null) {
                builder.field("_routing", this.routing());
            }
            if (this.fetchSourceContext() != null) {
                FetchSourceContext source = this.fetchSourceContext();
                String[] includes = source.includes();
                String[] excludes = source.excludes();
                if (includes.length == 0 && excludes.length == 0) {
                    builder.field("_source", source.fetchSource());
                } else if (includes.length > 0 && excludes.length == 0) {
                    builder.array("_source", source.includes());
View Full Code Here

        if (context == null) {
            request.fetchSourceContext(new FetchSourceContext(includes, excludes));
        }
        else {
            context.fetchSource(true);
            context.includes(includes);
            context.excludes(excludes);
        }
        return this;
    }
View Full Code Here

                String[] includes = source.includes();
                String[] excludes = source.excludes();
                if (includes.length == 0 && excludes.length == 0) {
                    builder.field("_source", source.fetchSource());
                } else if (includes.length > 0 && excludes.length == 0) {
                    builder.array("_source", source.includes());
                } else if (excludes.length > 0) {
                    builder.startObject("_source");
                    if (includes.length > 0) {
                        builder.array("includes", source.includes());
                    }
View Full Code Here

                } else if (includes.length > 0 && excludes.length == 0) {
                    builder.array("_source", source.includes());
                } else if (excludes.length > 0) {
                    builder.startObject("_source");
                    if (includes.length > 0) {
                        builder.array("includes", source.includes());
                    }
                    builder.array("excludes", source.excludes());
                    builder.endObject();
                }
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.