Package org.exist.storage

Examples of org.exist.storage.NodePath


    public boolean match(NodePath parentPath, NodePath other) {
        if (relPath == null) {
            return parentPath.match(other);
        } else {
            NodePath absPath = new NodePath(parentPath);
            absPath.append(relPath);
            return absPath.match(other);
        }
    }
View Full Code Here


    }

    private void scanMatches(NodeProxy p) {
        // Collect the text content of all descendants of p.
  // Remember the start offsets of the text nodes for later use.
        NodePath path = getPath(p);
        LuceneIndexConfig idxConf = config.getConfig(path).next();
       
        TextExtractor extractor = new DefaultTextExtractor();
        extractor.configure(config, idxConf);
        OffsetList offsets = new OffsetList();
View Full Code Here

            LOG.warn("Problem found while serializing XML: " + e.getMessage(), e);
        }
    }

    private NodePath getPath(NodeProxy proxy) {
        NodePath path = new NodePath();
        StoredNode node = (StoredNode) proxy.getNode();
        walkAncestor(node, path);
        return path;
    }
View Full Code Here

    private RangeIndexConfigField currentField = null;
    private int length = 0;

    public ComplexTextCollector(ComplexRangeIndexConfigElement configuration, NodePath parentPath) {
        this.config = configuration;
        this.parentPath = new NodePath(parentPath, false);
    }
View Full Code Here

                return;
            }
            final List<Predicate> preds = locationStep.getPredicates();

            // get path of path expression before the predicates
            NodePath contextPath = RangeQueryRewriter.toNodePath(RangeQueryRewriter.getPrecedingSteps(locationStep));

            rewritten = tryRewriteToFields(locationStep, preds, contextPath, contextSequence);
            axis = locationStep.getAxis();
        }
    }
View Full Code Here

                if (steps == null) {
                    notOptimizable.add(pred);
                    continue;
                }
                // compute left hand path
                NodePath innerPath = RangeQueryRewriter.toNodePath(steps);
                if (innerPath == null) {
                    notOptimizable.add(pred);
                    continue;
                }
                NodePath path = new NodePath(contextPath);
                path.append(innerPath);

                if (path.length() > 0) {
                    // find a range index configuration matching the full path to the predicate expression
                    RangeIndexConfigElement rice = findConfiguration(path, true, configs);
                    // found index configuration with sub-fields
                    if (rice != null && rice.isComplex() && rice.getNodePath().match(contextPath) && findConfiguration(path, false, configs) == null) {
                        // check for a matching sub-path and retrieve field information
View Full Code Here

        NodePath[] paths = new NodePath[pathSeq.getItemCount()];
        int i = 0;

        for (SequenceIterator iter = pathSeq.iterate(); iter.hasNext(); i++) {
            String path = iter.nextItem().getStringValue();
            paths[i] = new NodePath(mappings, path, false);
        }

        ContentReceiver receiver = new ContentReceiver(context, paths, ref, data);

        try {
View Full Code Here

            } else {
                // New element match, new data
               
                // Save reference to current path
                startElementPath = new NodePath(currentElementPath);
               
                // Store old fragment in stack
                context.pushDocumentContext();
               
                // Create new receiver
View Full Code Here

   
    public LuceneIndexConfig(Element config, Map<String, String> namespaces, AnalyzerConfig analyzers,
          Map<String, FieldType> fieldTypes) throws DatabaseConfigurationException {
        if (config.hasAttribute(QNAME_ATTR)) {
            QName qname = parseQName(config, namespaces);
            path = new NodePath(qname);
            isQNameIndex = true;
        } else {
            String matchPath = config.getAttribute(MATCH_ATTR);
            try {
        path = new NodePath(namespaces, matchPath);
        if (path.length() == 0)
            throw new DatabaseConfigurationException("Lucene module: Invalid match path in collection config: " +
                matchPath);
      } catch (IllegalArgumentException e) {
        throw new DatabaseConfigurationException("Lucene module: invalid qname in configuration: " + e.getMessage());
View Full Code Here

        canOptimize = true;
        return canOptimize;
    }

    private RangeIndexConfigElement findConfiguration(Sequence contextSequence) {
        NodePath path = contextPath;
        if (path == null) {
            if (contextQName == null) {
                return null;
            }
            path = new NodePath(contextQName);
        }
        for (final Iterator<Collection> i = contextSequence.getCollectionIterator(); i.hasNext(); ) {
            final Collection collection = i.next();
            if (collection.getURI().startsWith(XmldbURI.SYSTEM_COLLECTION_URI)) {
                continue;
View Full Code Here

TOP

Related Classes of org.exist.storage.NodePath

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.