use of io.lumeer.api.dto.JsonQuery in project engine by Lumeer.
the class SearchFacadeIT method testSearchCollectionsByEmptyQuery.
@Test
public void testSearchCollectionsByEmptyQuery() {
List<Collection> collections = searchFacade.searchCollections(new JsonQuery());
assertThat(collections).extracting(Collection::getId).containsOnlyElementsOf(collectionIds);
}
use of io.lumeer.api.dto.JsonQuery in project engine by Lumeer.
the class SearchFacadeIT method testSearchDocumentsByFullText.
@Test
public void testSearchDocumentsByFullText() {
String id1 = createDocument(collectionIds.get(0), "word").getId();
String id2 = createDocument(collectionIds.get(0), "fulltext").getId();
String id3 = createDocument(collectionIds.get(1), "something fulltext").getId();
String id4 = createDocument(collectionIds.get(1), "some other word").getId();
String id5 = createDocument(collectionIds.get(2), "full word").getId();
List<Document> documents = searchFacade.searchDocuments(new JsonQuery("fulltext"));
assertThat(documents).extracting(Document::getId).containsOnly(id2, id3);
documents = searchFacade.searchDocuments(new JsonQuery("word"));
assertThat(documents).extracting(Document::getId).containsOnly(id1, id4, id5);
}
use of io.lumeer.api.dto.JsonQuery in project engine by Lumeer.
the class SearchFacadeIT method testSearchDocumentsByIds.
@Test
public void testSearchDocumentsByIds() {
String id1 = createDocument(collectionIds.get(0), "doc1").getId();
String id2 = createDocument(collectionIds.get(0), "doc2").getId();
String id3 = createDocument(collectionIds.get(1), "doc3").getId();
String id4 = createDocument(collectionIds.get(1), "doc4").getId();
String id5 = createDocument(collectionIds.get(2), "doc5").getId();
String id6 = createDocument(collectionIds.get(2), "doc6").getId();
List<Document> documents = searchFacade.searchDocuments(new JsonQuery(null, null, new HashSet<>(Arrays.asList(id1, id4, id6))));
assertThat(documents).extracting(Document::getId).containsOnly(id1, id4, id6);
documents = searchFacade.searchDocuments(new JsonQuery(null, null, new HashSet<>(Arrays.asList(id2, id3, id4, id5))));
assertThat(documents).extracting(Document::getId).containsOnly(id2, id3, id4, id5);
}
Aggregations