Search in sources :

Example 16 with SearchQuery

use of org.hibernate.search.engine.search.query.SearchQuery in project hibernate-search by hibernate.

the class CompositeSearchProjectionIT method compositeList_fromSearchProjectionObjects.

@Test
public void compositeList_fromSearchProjectionObjects() {
    StubMappingScope scope = index.createScope();
    SearchQuery<List<?>> query = scope.query().select(f -> f.composite(f.field(index.binding().author.relativeFieldName, String.class).toProjection(), f.field(index.binding().title.relativeFieldName, String.class).toProjection())).where(f -> f.matchAll()).toQuery();
    assertThatQuery(query).hasHitsAnyOrder(Arrays.asList(index.binding().author.document1Value.indexedValue, index.binding().title.document1Value.indexedValue), Arrays.asList(index.binding().author.document2Value.indexedValue, index.binding().title.document2Value.indexedValue), Arrays.asList(index.binding().author.document3Value.indexedValue, index.binding().title.document3Value.indexedValue));
}
Also used : Arrays(java.util.Arrays) SearchSetupHelper(org.hibernate.search.integrationtest.backend.tck.testsupport.util.rule.SearchSetupHelper) Test(org.junit.Test) SearchResultAssert.assertThatQuery(org.hibernate.search.util.impl.integrationtest.common.assertion.SearchResultAssert.assertThatQuery) IndexSchemaElement(org.hibernate.search.engine.backend.document.model.dsl.IndexSchemaElement) Function(java.util.function.Function) Objects(java.util.Objects) IndexFieldReference(org.hibernate.search.engine.backend.document.IndexFieldReference) List(java.util.List) Rule(org.junit.Rule) LocalDate(java.time.LocalDate) StandardIndexFieldTypeOptionsStep(org.hibernate.search.engine.backend.types.dsl.StandardIndexFieldTypeOptionsStep) SearchQuery(org.hibernate.search.engine.search.query.SearchQuery) SimpleMappedIndex(org.hibernate.search.util.impl.integrationtest.mapper.stub.SimpleMappedIndex) StubMappingScope(org.hibernate.search.util.impl.integrationtest.mapper.stub.StubMappingScope) StandardFieldMapper(org.hibernate.search.integrationtest.backend.tck.testsupport.util.StandardFieldMapper) DocumentElement(org.hibernate.search.engine.backend.document.DocumentElement) Projectable(org.hibernate.search.engine.backend.types.Projectable) IndexFieldTypeFactory(org.hibernate.search.engine.backend.types.dsl.IndexFieldTypeFactory) Before(org.junit.Before) StubMappingScope(org.hibernate.search.util.impl.integrationtest.mapper.stub.StubMappingScope) List(java.util.List) Test(org.junit.Test)

Example 17 with SearchQuery

use of org.hibernate.search.engine.search.query.SearchQuery in project hibernate-search by hibernate.

the class CompositeSearchProjectionIT method nestedComposite.

@Test
public void nestedComposite() {
    StubMappingScope scope = index.createScope();
    SearchQuery<Book_Bi_Score> query = scope.query().select(f -> f.composite(Book_Bi_Score::new, f.composite(Book_Bi::new, f.field(index.binding().author.relativeFieldName, String.class), f.field(index.binding().title.relativeFieldName, String.class)), f.score())).where(f -> f.matchAll()).toQuery();
    assertThatQuery(query).hasHitsAnyOrder(new Book_Bi_Score(new Book_Bi(index.binding().author.document1Value.indexedValue, index.binding().title.document1Value.indexedValue), 1.0F), new Book_Bi_Score(new Book_Bi(index.binding().author.document2Value.indexedValue, index.binding().title.document2Value.indexedValue), 1.0F), new Book_Bi_Score(new Book_Bi(index.binding().author.document3Value.indexedValue, index.binding().title.document3Value.indexedValue), 1.0F));
}
Also used : Arrays(java.util.Arrays) SearchSetupHelper(org.hibernate.search.integrationtest.backend.tck.testsupport.util.rule.SearchSetupHelper) Test(org.junit.Test) SearchResultAssert.assertThatQuery(org.hibernate.search.util.impl.integrationtest.common.assertion.SearchResultAssert.assertThatQuery) IndexSchemaElement(org.hibernate.search.engine.backend.document.model.dsl.IndexSchemaElement) Function(java.util.function.Function) Objects(java.util.Objects) IndexFieldReference(org.hibernate.search.engine.backend.document.IndexFieldReference) List(java.util.List) Rule(org.junit.Rule) LocalDate(java.time.LocalDate) StandardIndexFieldTypeOptionsStep(org.hibernate.search.engine.backend.types.dsl.StandardIndexFieldTypeOptionsStep) SearchQuery(org.hibernate.search.engine.search.query.SearchQuery) SimpleMappedIndex(org.hibernate.search.util.impl.integrationtest.mapper.stub.SimpleMappedIndex) StubMappingScope(org.hibernate.search.util.impl.integrationtest.mapper.stub.StubMappingScope) StandardFieldMapper(org.hibernate.search.integrationtest.backend.tck.testsupport.util.StandardFieldMapper) DocumentElement(org.hibernate.search.engine.backend.document.DocumentElement) Projectable(org.hibernate.search.engine.backend.types.Projectable) IndexFieldTypeFactory(org.hibernate.search.engine.backend.types.dsl.IndexFieldTypeFactory) Before(org.junit.Before) StubMappingScope(org.hibernate.search.util.impl.integrationtest.mapper.stub.StubMappingScope) Test(org.junit.Test)

Example 18 with SearchQuery

use of org.hibernate.search.engine.search.query.SearchQuery in project hibernate-search by hibernate.

the class ElasticsearchExtensionIT method projection_nativeField_withProjectionConverters_disabled.

@Test
public void projection_nativeField_withProjectionConverters_disabled() {
    StubMappingScope scope = mainIndex.createScope();
    SearchQuery<JsonElement> query = scope.query().select(f -> f.field("nativeField_integer_converted", JsonElement.class, ValueConvert.NO)).where(f -> f.id().matching(SECOND_ID)).toQuery();
    assertThatQuery(query).hasHitsAnyOrder(new JsonPrimitive(2));
}
Also used : SearchException(org.hibernate.search.util.common.SearchException) JsonObject(com.google.gson.JsonObject) Backend(org.hibernate.search.engine.backend.Backend) ElasticsearchIndexManager(org.hibernate.search.backend.elasticsearch.index.ElasticsearchIndexManager) IndexObjectFieldReference(org.hibernate.search.engine.backend.document.IndexObjectFieldReference) InstanceOfAssertFactories(org.assertj.core.api.InstanceOfAssertFactories) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) SearchSetupHelper(org.hibernate.search.integrationtest.backend.tck.testsupport.util.rule.SearchSetupHelper) ElasticsearchSearchQueryWhereStep(org.hibernate.search.backend.elasticsearch.search.query.dsl.ElasticsearchSearchQueryWhereStep) JSONException(org.json.JSONException) Gson(com.google.gson.Gson) Map(java.util.Map) IndexManager(org.hibernate.search.engine.backend.index.IndexManager) StubMappingScope(org.hibernate.search.util.impl.integrationtest.mapper.stub.StubMappingScope) ElasticsearchSearchQueryOptionsStep(org.hibernate.search.backend.elasticsearch.search.query.dsl.ElasticsearchSearchQueryOptionsStep) SearchProjection(org.hibernate.search.engine.search.projection.SearchProjection) JsonHelper.assertJsonEquals(org.hibernate.search.util.impl.test.JsonHelper.assertJsonEquals) ElasticsearchSearchScrollResult(org.hibernate.search.backend.elasticsearch.search.query.ElasticsearchSearchScrollResult) IndexSchemaElement(org.hibernate.search.engine.backend.document.model.dsl.IndexSchemaElement) IndexSchemaObjectField(org.hibernate.search.engine.backend.document.model.dsl.IndexSchemaObjectField) Collectors(java.util.stream.Collectors) ElasticsearchIndexMetadataTestUtils.defaultPrimaryName(org.hibernate.search.util.impl.integrationtest.backend.elasticsearch.ElasticsearchIndexMetadataTestUtils.defaultPrimaryName) IndexFieldReference(org.hibernate.search.engine.backend.document.IndexFieldReference) List(java.util.List) TestForIssue(org.hibernate.search.util.impl.test.annotation.TestForIssue) Aggregable(org.hibernate.search.engine.backend.types.Aggregable) Response(org.elasticsearch.client.Response) JSONCompareMode(org.skyscreamer.jsonassert.JSONCompareMode) SearchHitsAssert.assertThatHits(org.hibernate.search.util.impl.integrationtest.common.assertion.SearchHitsAssert.assertThatHits) Optional(java.util.Optional) ElasticsearchBackend(org.hibernate.search.backend.elasticsearch.ElasticsearchBackend) Projectable(org.hibernate.search.engine.backend.types.Projectable) ElasticsearchSearchQuery(org.hibernate.search.backend.elasticsearch.search.query.ElasticsearchSearchQuery) RestClient(org.elasticsearch.client.RestClient) SearchLoadingContext(org.hibernate.search.engine.search.loading.spi.SearchLoadingContext) SearchIntegration(org.hibernate.search.engine.common.spi.SearchIntegration) SearchPredicate(org.hibernate.search.engine.search.predicate.SearchPredicate) SearchSort(org.hibernate.search.engine.search.sort.SearchSort) SearchResultAssert.assertThatQuery(org.hibernate.search.util.impl.integrationtest.common.assertion.SearchResultAssert.assertThatQuery) ObjectStructure(org.hibernate.search.engine.backend.types.ObjectStructure) ArrayList(java.util.ArrayList) ElasticsearchSearchResult(org.hibernate.search.backend.elasticsearch.search.query.ElasticsearchSearchResult) JsonElement(com.google.gson.JsonElement) Assertions.assertThatThrownBy(org.assertj.core.api.Assertions.assertThatThrownBy) ElasticsearchSearchScroll(org.hibernate.search.backend.elasticsearch.search.query.ElasticsearchSearchScroll) SimpleMappedIndex(org.hibernate.search.util.impl.integrationtest.mapper.stub.SimpleMappedIndex) ValueConvert(org.hibernate.search.engine.search.common.ValueConvert) JsonPrimitive(com.google.gson.JsonPrimitive) ElasticsearchSearchQuerySelectStep(org.hibernate.search.backend.elasticsearch.search.query.dsl.ElasticsearchSearchQuerySelectStep) DocumentElement(org.hibernate.search.engine.backend.document.DocumentElement) DocumentReference(org.hibernate.search.engine.backend.common.DocumentReference) ValueWrapper(org.hibernate.search.integrationtest.backend.tck.testsupport.util.ValueWrapper) Before(org.junit.Before) Sortable(org.hibernate.search.engine.backend.types.Sortable) AggregationKey(org.hibernate.search.engine.search.aggregation.AggregationKey) Test(org.junit.Test) Assertions.entry(org.assertj.core.api.Assertions.entry) SearchResultAssert.assertThatResult(org.hibernate.search.util.impl.integrationtest.common.assertion.SearchResultAssert.assertThatResult) Request(org.elasticsearch.client.Request) ElasticsearchExtension(org.hibernate.search.backend.elasticsearch.ElasticsearchExtension) Rule(org.junit.Rule) StubLoadingOptionsStep(org.hibernate.search.util.impl.integrationtest.mapper.stub.StubLoadingOptionsStep) SearchQuery(org.hibernate.search.engine.search.query.SearchQuery) HttpAsyncClient(org.apache.http.nio.client.HttpAsyncClient) StubMappingScope(org.hibernate.search.util.impl.integrationtest.mapper.stub.StubMappingScope) JsonPrimitive(com.google.gson.JsonPrimitive) JsonElement(com.google.gson.JsonElement) Test(org.junit.Test)

Example 19 with SearchQuery

use of org.hibernate.search.engine.search.query.SearchQuery in project hibernate-search by hibernate.

the class ElasticsearchExtensionIT method predicate_nativeField_withDslConverter_disabled.

@Test
public void predicate_nativeField_withDslConverter_disabled() {
    StubMappingScope scope = mainIndex.createScope();
    SearchQuery<DocumentReference> query = scope.query().where(f -> f.match().field("nativeField_integer_converted").matching(new JsonPrimitive(2), ValueConvert.NO)).toQuery();
    assertThatQuery(query).hasDocRefHitsAnyOrder(mainIndex.typeName(), SECOND_ID).hasTotalHitCount(1);
}
Also used : SearchException(org.hibernate.search.util.common.SearchException) JsonObject(com.google.gson.JsonObject) Backend(org.hibernate.search.engine.backend.Backend) ElasticsearchIndexManager(org.hibernate.search.backend.elasticsearch.index.ElasticsearchIndexManager) IndexObjectFieldReference(org.hibernate.search.engine.backend.document.IndexObjectFieldReference) InstanceOfAssertFactories(org.assertj.core.api.InstanceOfAssertFactories) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) SearchSetupHelper(org.hibernate.search.integrationtest.backend.tck.testsupport.util.rule.SearchSetupHelper) ElasticsearchSearchQueryWhereStep(org.hibernate.search.backend.elasticsearch.search.query.dsl.ElasticsearchSearchQueryWhereStep) JSONException(org.json.JSONException) Gson(com.google.gson.Gson) Map(java.util.Map) IndexManager(org.hibernate.search.engine.backend.index.IndexManager) StubMappingScope(org.hibernate.search.util.impl.integrationtest.mapper.stub.StubMappingScope) ElasticsearchSearchQueryOptionsStep(org.hibernate.search.backend.elasticsearch.search.query.dsl.ElasticsearchSearchQueryOptionsStep) SearchProjection(org.hibernate.search.engine.search.projection.SearchProjection) JsonHelper.assertJsonEquals(org.hibernate.search.util.impl.test.JsonHelper.assertJsonEquals) ElasticsearchSearchScrollResult(org.hibernate.search.backend.elasticsearch.search.query.ElasticsearchSearchScrollResult) IndexSchemaElement(org.hibernate.search.engine.backend.document.model.dsl.IndexSchemaElement) IndexSchemaObjectField(org.hibernate.search.engine.backend.document.model.dsl.IndexSchemaObjectField) Collectors(java.util.stream.Collectors) ElasticsearchIndexMetadataTestUtils.defaultPrimaryName(org.hibernate.search.util.impl.integrationtest.backend.elasticsearch.ElasticsearchIndexMetadataTestUtils.defaultPrimaryName) IndexFieldReference(org.hibernate.search.engine.backend.document.IndexFieldReference) List(java.util.List) TestForIssue(org.hibernate.search.util.impl.test.annotation.TestForIssue) Aggregable(org.hibernate.search.engine.backend.types.Aggregable) Response(org.elasticsearch.client.Response) JSONCompareMode(org.skyscreamer.jsonassert.JSONCompareMode) SearchHitsAssert.assertThatHits(org.hibernate.search.util.impl.integrationtest.common.assertion.SearchHitsAssert.assertThatHits) Optional(java.util.Optional) ElasticsearchBackend(org.hibernate.search.backend.elasticsearch.ElasticsearchBackend) Projectable(org.hibernate.search.engine.backend.types.Projectable) ElasticsearchSearchQuery(org.hibernate.search.backend.elasticsearch.search.query.ElasticsearchSearchQuery) RestClient(org.elasticsearch.client.RestClient) SearchLoadingContext(org.hibernate.search.engine.search.loading.spi.SearchLoadingContext) SearchIntegration(org.hibernate.search.engine.common.spi.SearchIntegration) SearchPredicate(org.hibernate.search.engine.search.predicate.SearchPredicate) SearchSort(org.hibernate.search.engine.search.sort.SearchSort) SearchResultAssert.assertThatQuery(org.hibernate.search.util.impl.integrationtest.common.assertion.SearchResultAssert.assertThatQuery) ObjectStructure(org.hibernate.search.engine.backend.types.ObjectStructure) ArrayList(java.util.ArrayList) ElasticsearchSearchResult(org.hibernate.search.backend.elasticsearch.search.query.ElasticsearchSearchResult) JsonElement(com.google.gson.JsonElement) Assertions.assertThatThrownBy(org.assertj.core.api.Assertions.assertThatThrownBy) ElasticsearchSearchScroll(org.hibernate.search.backend.elasticsearch.search.query.ElasticsearchSearchScroll) SimpleMappedIndex(org.hibernate.search.util.impl.integrationtest.mapper.stub.SimpleMappedIndex) ValueConvert(org.hibernate.search.engine.search.common.ValueConvert) JsonPrimitive(com.google.gson.JsonPrimitive) ElasticsearchSearchQuerySelectStep(org.hibernate.search.backend.elasticsearch.search.query.dsl.ElasticsearchSearchQuerySelectStep) DocumentElement(org.hibernate.search.engine.backend.document.DocumentElement) DocumentReference(org.hibernate.search.engine.backend.common.DocumentReference) ValueWrapper(org.hibernate.search.integrationtest.backend.tck.testsupport.util.ValueWrapper) Before(org.junit.Before) Sortable(org.hibernate.search.engine.backend.types.Sortable) AggregationKey(org.hibernate.search.engine.search.aggregation.AggregationKey) Test(org.junit.Test) Assertions.entry(org.assertj.core.api.Assertions.entry) SearchResultAssert.assertThatResult(org.hibernate.search.util.impl.integrationtest.common.assertion.SearchResultAssert.assertThatResult) Request(org.elasticsearch.client.Request) ElasticsearchExtension(org.hibernate.search.backend.elasticsearch.ElasticsearchExtension) Rule(org.junit.Rule) StubLoadingOptionsStep(org.hibernate.search.util.impl.integrationtest.mapper.stub.StubLoadingOptionsStep) SearchQuery(org.hibernate.search.engine.search.query.SearchQuery) HttpAsyncClient(org.apache.http.nio.client.HttpAsyncClient) StubMappingScope(org.hibernate.search.util.impl.integrationtest.mapper.stub.StubMappingScope) JsonPrimitive(com.google.gson.JsonPrimitive) DocumentReference(org.hibernate.search.engine.backend.common.DocumentReference) Test(org.junit.Test)

Example 20 with SearchQuery

use of org.hibernate.search.engine.search.query.SearchQuery in project hibernate-search by hibernate.

the class ElasticsearchExtensionIT method sort_nativeField_jsonObject.

@Test
public void sort_nativeField_jsonObject() {
    StubMappingScope scope = mainIndex.createScope();
    SearchQuery<DocumentReference> query = scope.query().where(f -> f.matchAll()).sort(f -> f.extension(ElasticsearchExtension.get()).fromJson(gson.fromJson("{'nativeField_sort1': 'asc'}", JsonObject.class)).then().extension(ElasticsearchExtension.get()).fromJson(gson.fromJson("{'nativeField_sort2': 'asc'}", JsonObject.class)).then().extension(ElasticsearchExtension.get()).fromJson(gson.fromJson("{'nativeField_sort3': 'asc'}", JsonObject.class)).then().extension(ElasticsearchExtension.get()).fromJson(gson.fromJson("{'nativeField_sort4': {'order': 'asc', 'missing': '_last'}}", JsonObject.class)).then().extension(ElasticsearchExtension.get()).fromJson(gson.fromJson("{'nativeField_sort5': {'order': 'asc', 'missing': '_first'}}", JsonObject.class))).toQuery();
    assertThatQuery(query).hasDocRefHitsExactOrder(mainIndex.typeName(), FIRST_ID, SECOND_ID, THIRD_ID, FOURTH_ID, EMPTY_ID, FIFTH_ID);
    query = scope.query().where(f -> f.matchAll()).sort(f -> f.extension(ElasticsearchExtension.get()).fromJson(gson.fromJson("{'nativeField_sort1': 'desc'}", JsonObject.class)).then().extension(ElasticsearchExtension.get()).fromJson(gson.fromJson("{'nativeField_sort2': 'desc'}", JsonObject.class)).then().extension(ElasticsearchExtension.get()).fromJson(gson.fromJson("{'nativeField_sort3': 'desc'}", JsonObject.class)).then().extension(ElasticsearchExtension.get()).fromJson(gson.fromJson("{'nativeField_sort4': {'order': 'desc', 'missing': '_last'}}", JsonObject.class)).then().extension(ElasticsearchExtension.get()).fromJson(gson.fromJson("{'nativeField_sort5': {'order': 'asc', 'missing': '_first'}}", JsonObject.class))).toQuery();
    assertThatQuery(query).hasDocRefHitsExactOrder(mainIndex.typeName(), FOURTH_ID, THIRD_ID, SECOND_ID, FIRST_ID, EMPTY_ID, FIFTH_ID);
}
Also used : SearchException(org.hibernate.search.util.common.SearchException) JsonObject(com.google.gson.JsonObject) Backend(org.hibernate.search.engine.backend.Backend) ElasticsearchIndexManager(org.hibernate.search.backend.elasticsearch.index.ElasticsearchIndexManager) IndexObjectFieldReference(org.hibernate.search.engine.backend.document.IndexObjectFieldReference) InstanceOfAssertFactories(org.assertj.core.api.InstanceOfAssertFactories) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) SearchSetupHelper(org.hibernate.search.integrationtest.backend.tck.testsupport.util.rule.SearchSetupHelper) ElasticsearchSearchQueryWhereStep(org.hibernate.search.backend.elasticsearch.search.query.dsl.ElasticsearchSearchQueryWhereStep) JSONException(org.json.JSONException) Gson(com.google.gson.Gson) Map(java.util.Map) IndexManager(org.hibernate.search.engine.backend.index.IndexManager) StubMappingScope(org.hibernate.search.util.impl.integrationtest.mapper.stub.StubMappingScope) ElasticsearchSearchQueryOptionsStep(org.hibernate.search.backend.elasticsearch.search.query.dsl.ElasticsearchSearchQueryOptionsStep) SearchProjection(org.hibernate.search.engine.search.projection.SearchProjection) JsonHelper.assertJsonEquals(org.hibernate.search.util.impl.test.JsonHelper.assertJsonEquals) ElasticsearchSearchScrollResult(org.hibernate.search.backend.elasticsearch.search.query.ElasticsearchSearchScrollResult) IndexSchemaElement(org.hibernate.search.engine.backend.document.model.dsl.IndexSchemaElement) IndexSchemaObjectField(org.hibernate.search.engine.backend.document.model.dsl.IndexSchemaObjectField) Collectors(java.util.stream.Collectors) ElasticsearchIndexMetadataTestUtils.defaultPrimaryName(org.hibernate.search.util.impl.integrationtest.backend.elasticsearch.ElasticsearchIndexMetadataTestUtils.defaultPrimaryName) IndexFieldReference(org.hibernate.search.engine.backend.document.IndexFieldReference) List(java.util.List) TestForIssue(org.hibernate.search.util.impl.test.annotation.TestForIssue) Aggregable(org.hibernate.search.engine.backend.types.Aggregable) Response(org.elasticsearch.client.Response) JSONCompareMode(org.skyscreamer.jsonassert.JSONCompareMode) SearchHitsAssert.assertThatHits(org.hibernate.search.util.impl.integrationtest.common.assertion.SearchHitsAssert.assertThatHits) Optional(java.util.Optional) ElasticsearchBackend(org.hibernate.search.backend.elasticsearch.ElasticsearchBackend) Projectable(org.hibernate.search.engine.backend.types.Projectable) ElasticsearchSearchQuery(org.hibernate.search.backend.elasticsearch.search.query.ElasticsearchSearchQuery) RestClient(org.elasticsearch.client.RestClient) SearchLoadingContext(org.hibernate.search.engine.search.loading.spi.SearchLoadingContext) SearchIntegration(org.hibernate.search.engine.common.spi.SearchIntegration) SearchPredicate(org.hibernate.search.engine.search.predicate.SearchPredicate) SearchSort(org.hibernate.search.engine.search.sort.SearchSort) SearchResultAssert.assertThatQuery(org.hibernate.search.util.impl.integrationtest.common.assertion.SearchResultAssert.assertThatQuery) ObjectStructure(org.hibernate.search.engine.backend.types.ObjectStructure) ArrayList(java.util.ArrayList) ElasticsearchSearchResult(org.hibernate.search.backend.elasticsearch.search.query.ElasticsearchSearchResult) JsonElement(com.google.gson.JsonElement) Assertions.assertThatThrownBy(org.assertj.core.api.Assertions.assertThatThrownBy) ElasticsearchSearchScroll(org.hibernate.search.backend.elasticsearch.search.query.ElasticsearchSearchScroll) SimpleMappedIndex(org.hibernate.search.util.impl.integrationtest.mapper.stub.SimpleMappedIndex) ValueConvert(org.hibernate.search.engine.search.common.ValueConvert) JsonPrimitive(com.google.gson.JsonPrimitive) ElasticsearchSearchQuerySelectStep(org.hibernate.search.backend.elasticsearch.search.query.dsl.ElasticsearchSearchQuerySelectStep) DocumentElement(org.hibernate.search.engine.backend.document.DocumentElement) DocumentReference(org.hibernate.search.engine.backend.common.DocumentReference) ValueWrapper(org.hibernate.search.integrationtest.backend.tck.testsupport.util.ValueWrapper) Before(org.junit.Before) Sortable(org.hibernate.search.engine.backend.types.Sortable) AggregationKey(org.hibernate.search.engine.search.aggregation.AggregationKey) Test(org.junit.Test) Assertions.entry(org.assertj.core.api.Assertions.entry) SearchResultAssert.assertThatResult(org.hibernate.search.util.impl.integrationtest.common.assertion.SearchResultAssert.assertThatResult) Request(org.elasticsearch.client.Request) ElasticsearchExtension(org.hibernate.search.backend.elasticsearch.ElasticsearchExtension) Rule(org.junit.Rule) StubLoadingOptionsStep(org.hibernate.search.util.impl.integrationtest.mapper.stub.StubLoadingOptionsStep) SearchQuery(org.hibernate.search.engine.search.query.SearchQuery) HttpAsyncClient(org.apache.http.nio.client.HttpAsyncClient) StubMappingScope(org.hibernate.search.util.impl.integrationtest.mapper.stub.StubMappingScope) JsonObject(com.google.gson.JsonObject) DocumentReference(org.hibernate.search.engine.backend.common.DocumentReference) Test(org.junit.Test)

Aggregations

SearchQuery (org.hibernate.search.engine.search.query.SearchQuery)229 Test (org.junit.Test)222 Rule (org.junit.Rule)197 SearchSetupHelper (org.hibernate.search.integrationtest.backend.tck.testsupport.util.rule.SearchSetupHelper)186 IndexSchemaElement (org.hibernate.search.engine.backend.document.model.dsl.IndexSchemaElement)185 SimpleMappedIndex (org.hibernate.search.util.impl.integrationtest.mapper.stub.SimpleMappedIndex)185 StubMappingScope (org.hibernate.search.util.impl.integrationtest.mapper.stub.StubMappingScope)179 Before (org.junit.Before)177 SearchResultAssert.assertThatQuery (org.hibernate.search.util.impl.integrationtest.common.assertion.SearchResultAssert.assertThatQuery)164 List (java.util.List)158 IndexFieldReference (org.hibernate.search.engine.backend.document.IndexFieldReference)153 DocumentReference (org.hibernate.search.engine.backend.common.DocumentReference)151 Assertions.assertThatThrownBy (org.assertj.core.api.Assertions.assertThatThrownBy)135 TestForIssue (org.hibernate.search.util.impl.test.annotation.TestForIssue)129 Projectable (org.hibernate.search.engine.backend.types.Projectable)127 SearchException (org.hibernate.search.util.common.SearchException)119 DocumentElement (org.hibernate.search.engine.backend.document.DocumentElement)113 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)110 IndexObjectFieldReference (org.hibernate.search.engine.backend.document.IndexObjectFieldReference)102 IndexSchemaObjectField (org.hibernate.search.engine.backend.document.model.dsl.IndexSchemaObjectField)102