code: protected List<Object> populateUsingLucene(EntityMetadata m, Client client, List<Object> result,
              String[] columnsToSelect)
      {
          Set<Object> uniquePKs = null;
  
          MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
                  m.getPersistenceUnit());
          if (client.getIndexManager().getIndexer().getClass().getName().equals(IndexingConstants.LUCENE_INDEXER))
          {
              String luceneQ = KunderaCoreUtils.getLuceneQueryFromJPAQuery(kunderaQuery, kunderaMetadata);
  
              Map<String, Object> searchFilter = client.getIndexManager().search(m.getEntityClazz(), luceneQ,
                      Constants.INVALID, Constants.INVALID);
              // Map<String, Object> searchFilter =
              // client.getIndexManager().search(kunderaMetadata, kunderaQuery,
              // persistenceDelegeator, m);
              boolean isEmbeddedId = metaModel.isEmbeddable(m.getIdAttribute().getBindableJavaType());
  
              if (isEmbeddedId)
              {
                  return populateEmbeddedIdUsingLucene(m, client, result, searchFilter, metaModel);
              }
  
              Object[] primaryKeys = searchFilter.values().toArray(new Object[] {});
              // Object[] primaryKeys =
              // ((List)searchFilter.get("primaryKeys")).toArray(new Object[] {});
  
              uniquePKs = new HashSet<Object>(Arrays.asList(primaryKeys));
              return findUsingLucene(m, client, uniquePKs.toArray());
          }
          else
          {
              return populateUsingElasticSearch(client, m);
  
          }
  
      }
docs: Populate using lucene.
  
  @param m
  the m
  @param client
  the client
  @param result
  the result
  @param columnsToSelect
  List of column names to be selected (rest should be ignored)
  @return the list