Example usage for org.springframework.data.solr.core.query Query addProjectionOnField

List of usage examples for org.springframework.data.solr.core.query Query addProjectionOnField

Introduction

In this page you can find the example usage for org.springframework.data.solr.core.query Query addProjectionOnField.

Prototype

<T extends Query> T addProjectionOnField(Field field);

Source Link

Document

add given Field to those included in result.

Usage

From source file:org.springframework.data.solr.core.query.SimpleQueryTest.java

@Test
public void testCloneQueryWithProjection() {
    Query source = new SimpleQuery(new Criteria("field_1").is("value_1"));
    source.addProjectionOnField(new SimpleField("field_2"));

    Query destination = SimpleQuery.fromQuery(source);
    Assert.assertEquals(1, destination.getProjectionOnFields().size());
}