Project

General

Profile

« Previous | Next » 

Revision 3182

One more patch for bug 2469:
Although the correct parentid values were being indexed in xml_path_index
for leaf node xpaths, they were still incorrect for relative and absolute
paths. This patch modifies traverseParents() and changes the parent node id
to be indexed to that of the leaf node, no matter if the path is a leaf,
relative, or absolute. Thanks for catching this Duane.

View differences:

src/edu/ucsb/nceas/metacat/DocumentImpl.java
1397 1397
        float nodeDataNumerical = current.getNodeDataNumerical();
1398 1398
        NodeRecord leafRecord = (NodeRecord)records.get(new Long(leafNodeId));
1399 1399
        String leafData = leafRecord.getNodeData();
1400
        long leafParentId = leafRecord.getParentNodeId();
1400 1401
        float leafDataNumerical = leafRecord.getNodeDataNumerical();
1401 1402
        
1402 1403
        if ( current.getNodeType().equals("ELEMENT") ||
......
1418 1419
                    leafData.trim().length() != 0 ){
1419 1420
                	logMetacat.debug("paths found for indexing: " + currentName);
1420 1421
                	pathsFoundForIndexing.put(currentName, new PathIndexEntry(
1421
                            leafNodeId, currentName, docid, parentId, leafData,
1422
                            leafNodeId, currentName, docid, leafParentId, leafData,
1422 1423
                            leafDataNumerical));
1423 1424
                } 
1424 1425
            }
......
1442 1443
                    leafData.trim().length() != 0 ){
1443 1444
                	logMetacat.debug("paths found for indexing: " + currentName);
1444 1445
                	pathsFoundForIndexing.put(path, new PathIndexEntry(
1445
                            leafNodeId, path, docid, parentId, leafData,
1446
                            leafNodeId, path, docid, leafParentId, leafData,
1446 1447
                            leafDataNumerical));
1447 1448
                }
1448 1449
            }
......
1459 1460
                   leafData.trim().length() != 0 ){
1460 1461
                	logMetacat.debug("paths found for indexing: " + currentName);
1461 1462
                	pathsFoundForIndexing.put(fullPath, new PathIndexEntry(
1462
                            leafNodeId, fullPath, docid, parentId, leafData,
1463
                            leafNodeId, fullPath, docid, leafParentId, leafData,
1463 1464
                            leafDataNumerical));
1464 1465
                }
1465 1466
            }

Also available in: Unified diff