code: private List<Object> findUsingLucene(EntityMetadata m, Client client, Object[] primaryKeys)
      {
  
          String idField = m.getIdAttribute().getName();
          String equals = "=";
          MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
                  m.getPersistenceUnit());
          EntityType entityType = metaModel.entity(m.getEntityClazz());
          String columnName = ((AbstractAttribute) entityType.getAttribute(idField)).getJPAColumnName();
          List<Object> result = new ArrayList<Object>();
          Queue queue = getKunderaQuery().getFilterClauseQueue();
          KunderaQuery kunderaQuery = getKunderaQuery();
  
          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;
      }
docs: find data using lucene.
  
  @param m
  the m
  @param client
  the client
  @param primaryKeys
  the primary keys
  @return the list