@Override
    public Object[] findIdsByColumn(String schemaName, String tableName, String pKeyName, String columnName,
            Object columnValue, Class entityClazz)
    {

        TermQueryBuilder filter = QueryBuilders.termQuery(columnName, columnValue);

        SearchResponse response = txClient.prepareSearch(schemaName.toLowerCase()).setTypes(tableName)
                .addField(pKeyName).setPostFilter(filter).execute().actionGet();

        SearchHits hits = response.getHits();

        Long length = hits.getTotalHits();
        int absoluteLength = length.intValue();
        Object[] ids = new Object[absoluteLength];

        int counter = 0;
        for (SearchHit hit : hits.getHits())
        {
            Map<String, SearchHitField> fields = hit.getFields();
            ids[counter++] = fields.get(pKeyName).getValue();
        }

        return ids;
    }
@ Override public Object [ ] findIdsByColumn ( String schemaName , String tableName , String pKeyName , String columnName , Object columnValue , Class entityClazz ) { TermQueryBuilder filter = QueryBuilders . termQuery ( columnName , columnValue ) ; SearchResponse response = txClient . prepareSearch ( schemaName . toLowerCase ( ) ) . setTypes ( tableName ) . addField ( pKeyName ) . setPostFilter ( filter ) . execute ( ) . actionGet ( ) ; SearchHits hits = response . getHits ( ) ; Long length = hits . getTotalHits ( ) ; int absoluteLength = length . intValue ( ) ; Object [ ] ids = new Object [ absoluteLength ] ; int counter = 0 ; for ( SearchHit hit : hits . getHits ( ) ) { Map < String , SearchHitField > fields = hit . getFields ( ) ; ids [ counter ++ ] = fields . get ( pKeyName ) . getValue ( ) ; } return ids ; }
/*
(non-Javadoc)

@see com.impetus.kundera.client.Client#findIdsByColumn(java.lang.String,
java.lang.String, java.lang.String, java.lang.String, java.lang.Object,
java.lang.Class)