directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Selcuk AYA <ayasel...@gmail.com>
Subject Modification of Index Entries through search engine
Date Tue, 29 Nov 2011 19:53:01 GMT
Hi,
I am doing some tests on txns and the following causes problems for the test:
    most of the default search engine evaluators cast Index<UUID> to
Index<Object> or Index<String> and then call the setValue method of
the index entry to modify it  when there is no index on the attribute.
Index<UUID> entry comes from the uuid cursor.  I would like to get rid
of this as it is causing problems for the txns layer. Txn layer is
maintaining some set of index entries in memory and when they are
modified by the search engine it gets confused. In general any layer
or cursor which maintained a cache of index entries would get confused
in such a scenario.

Please let me the reason we change the index entry in such a way and
we can hopefully get rid of it. I commented out such code for the
cases it caused me trouble and the tests passed.

An example is here. ( Note the inconsistency-- setValue is not called
for the binary value case):

 // if the attribute exists and the pattern matches return true
        if ( attr != null )
        {
            /*
             * Cycle through the attribute values testing normalized version
             * obtained from using the substring matching rule's normalizer.
             * The test uses the comparator obtained from the appropriate
             * substring matching rule.
             */
            if ( attr.isHumanReadable() )
            {
                for ( Value<?> value : attr )
                {
                    String strValue = ( String ) value.getNormValue();

                    // Once match is found cleanup and return true
                    if ( regex.matcher( strValue ).matches() )
                    {
                        // before returning we set the normalized value
                        indexEntry.setValue( strValue );
                        return true;
                    }
                }
            }
            else
            {
                // Slightly more complex. We won't be able to use a
regex to check
                // the value.
                for ( Value<?> value : attr )
                {
                    byte[] byteValue = (byte[])value.getNormValue();

                    // Once match is found cleanup and return true
                    // @TODO : implement this check.
                    /*
                    if ( check( byteValue ) )
                    {
                        // before returning we set the normalized value
                        indexEntry.setValue( byteValue );
                        return true;
                    }
                    */
                }
            }

regards
Selcuk

Mime
View raw message