Skip to content

How to search a single field of the EncrtypedRow data #64

Description

@MadhavPrabu

Hi,
I have an issue to search a single field value & decrypt the single field value. When i tried to get the compound index for this, i got some new index. But in case, when i had given all the field data, then i got the same compound index.

What is the use of Compound index and how to search the single field data.
If i had used the blind index and it works fine like getting the same index.

For Example, i had use the ssn in blind index, and in compound index i had the fields like ssn, email, hivstatus.

$row->addBlindIndex(
    'ssn',
    new BlindIndex(
        'ssn_last_four_idx',
        [new LastFourDigits()],
        32 // 32 bits = 4 bytes
    )
);

$row->addCompoundIndex(
    (
        new CompoundIndex(
            'ssnlast4_hivstatus_cidx',
            ['ssn', 'email', 'hivstatus'],
            32, // 32 bits = 4 bytes
            true // fast hash
        )
    )->addTransform('ssn', new LastFourDigits())
);

$searchinputdata    = array('ssn'    =>  '123-45-6789');

$searchinputdata_cidx = array(''email'     => 'jane@example.com');


Stored indexex:
ssn_last_four_idx 		1258bc5e                // Blind Index
ssnlast4_hivstatus_cidx	9fbf99d5                  // Compound Index 

To search data,
when i use to get the blind index for ssn, it returns the same index value

$row->getBlindIndex('ssn_last_four_idx',$searchinputdata);

returns Blind Index (ssn_last_four_idx) as 1258bc5e

But when i tried to get compound index only with email, then it returns new compound index

$row->getBlindIndex('ssnlast4_hivstatus_cidx',$searchinputdata_cidx);

returns Compound Index (ssnlast4_hivstatus_cidx) as 1a1937b2

I need the clarification and help on this issue to achieve the search with compound index and decrypt the same.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions