I have this scan expression which returns a list of blogs matching the query (By title). How can I scan multiple attributes in the table and also ignore the case of the query?
public List<BlogDetailsEntity> searchBlogs(String query) {
try {
DynamoDBScanExpression scanExpression = new DynamoDBScanExpression();
scanExpression.addFilterCondition("title", new Condition()
.withComparisonOperator(ComparisonOperator.CONTAINS)
.withAttributeValueList(new AttributeValue().withS(query)));
scanExpression.addFilterCondition("shortDescription", new Condition()
.withComparisonOperator(ComparisonOperator.CONTAINS)
.withAttributeValueList(new AttributeValue().withS(query)));
return dynamoDBMapper.scan(BlogDetailsEntity.class, scanExpression);
} catch (Exception ex) {
log.error("failed to get blogs > " + query);
}
return null;
}