use of io.lumeer.storage.api.query.SuggestionQuery in project engine by Lumeer.
the class SuggestionFacade method suggestCollections.
private List<Collection> suggestCollections(String text, int limit) {
SuggestionQuery suggestionQuery = createSuggestionQuery(text, limit);
List<Collection> collections = collectionDao.getCollections(suggestionQuery);
collections.forEach(c -> c.setAttributes(Collections.emptySet()));
return collections;
}
use of io.lumeer.storage.api.query.SuggestionQuery in project engine by Lumeer.
the class MongoViewDaoTest method testGetViewsBySuggestionTextDifferentUser.
@Test
public void testGetViewsBySuggestionTextDifferentUser() {
createView(CODE, NAME);
createView(CODE2, NAME2);
createView(CODE3, NAME3);
SuggestionQuery query = SuggestionQuery.createBuilder(USER2).text("test").build();
List<View> views = viewDao.getViews(query);
assertThat(views).extracting(View::getCode).isEmpty();
}
use of io.lumeer.storage.api.query.SuggestionQuery in project engine by Lumeer.
the class MorphiaCollectionDaoTest method testGetCollectionsByAttributesSuggestions.
@Test
public void testGetCollectionsByAttributesSuggestions() {
createCollection(CODE, NAME, Collections.emptySet());
createCollection(CODE2, NAME2, ATTRIBUTES);
createCollection(CODE3, NAME3, ATTRIBUTES_FULLTEXT);
SuggestionQuery suggestionQuery = SuggestionQuery.createBuilder(USER).text("sugg").build();
List<Collection> collections = collectionDao.getCollectionsByAttributes(suggestionQuery);
assertThat(collections).extracting(Resource::getCode).containsOnly(CODE2, CODE3);
}
use of io.lumeer.storage.api.query.SuggestionQuery in project engine by Lumeer.
the class MorphiaCollectionDaoTest method testGetCollectionsByAttributesSuggestionsDifferentUser.
@Test
public void testGetCollectionsByAttributesSuggestionsDifferentUser() {
createCollection(CODE, NAME, Collections.emptySet());
createCollection(CODE2, NAME2, ATTRIBUTES);
createCollection(CODE3, NAME3, ATTRIBUTES_FULLTEXT);
SuggestionQuery suggestionQuery = SuggestionQuery.createBuilder(USER2).text("sugg").build();
List<Collection> collections = collectionDao.getCollectionsByAttributes(suggestionQuery);
assertThat(collections).isEmpty();
}
use of io.lumeer.storage.api.query.SuggestionQuery in project engine by Lumeer.
the class MorphiaViewDaoTest method testGetViewsBySuggestionText.
@Test
public void testGetViewsBySuggestionText() {
createView(CODE, NAME);
createView(CODE2, NAME2);
createView(CODE3, NAME3);
SuggestionQuery query = SuggestionQuery.createBuilder(USER).text("test").build();
List<View> views = viewDao.getViews(query);
assertThat(views).extracting(View::getCode).containsOnly(CODE, CODE2);
}
Aggregations