-
Notifications
You must be signed in to change notification settings - Fork 232
Open
Description
I don't understand why this place is looping instead of one query,It's pointless to sort by looping
private List<Object> findUsingLucene(EntityMetadata m, Client client, Object[] primaryKeys)
{
xxxxx
for (Object primaryKey : primaryKeys)
{
FilterClause filterClause = kunderaQuery.new FilterClause(columnName, equals, primaryKey, idField);
kunderaQuery.setFilter(kunderaQuery.getEntityAlias() + "." + columnName + " = " + primaryKey);
queue.clear();
queue.add(filterClause);
List<Object> object = findUsingLucene(m, client);
if (object != null && !object.isEmpty())
result.add(object.get(0));
}
return result;
} protected List findUsingLucene(EntityMetadata m, Client client)
{
try
{
BasicDBObject orderByClause = getOrderByClause(m);
// find on id, so no need to add skip() [firstResult hardcoded 0]
return ((MongoDBClient) client).loadData(m, createMongoQuery(m, getKunderaQuery().getFilterClauseQueue()),
null, orderByClause, isSingleResult ? 1 : maxResult, 0, isCountQuery(),
getKeys(m, getKunderaQuery().getResult()), getKunderaQuery().getResult());
}
catch (Exception e)
{
log.error("Error during executing query, Caused by:", e);
throw new QueryHandlerException(e);
}
}Metadata
Metadata
Assignees
Labels
No labels