Package org.exist.storage

Examples of org.exist.storage.IndexSpec


            final Collection collection = i.next();

            if( collection.getURI().equalsInternal( XmldbURI.SYSTEM_COLLECTION_URI ) ) {
                continue;
            }
            final IndexSpec idxcfg = collection.getIndexConfiguration( context.getBroker() );

            if( idxflags.indexOnQName && ( idxcfg.getIndexByQName( contextQName ) == null ) ) {
                idxflags.indexOnQName = false;

                if( LOG.isTraceEnabled() ) {
                    LOG.trace( "cannot use index on QName: " + contextQName + ". Collection " + collection.getURI() + " does not define an index" );
                }
            }

            if( !idxflags.hasIndexOnQNames && idxcfg.hasIndexesByQName() ) {
                idxflags.hasIndexOnQNames = true;
            }

            if( !idxflags.hasIndexOnPaths && idxcfg.hasIndexesByPath() ) {
                idxflags.hasIndexOnPaths = true;
            }
        }
        return( idxflags );
    }
View Full Code Here


    protected void reset(DBBroker broker, NodeProxy proxy) {
        this.broker = broker;
        this.match = proxy.getMatches();
        setNextInChain(null);

        IndexSpec indexConf = proxy.getDocument().getCollection().getIndexConfiguration(broker);
        if (indexConf != null)
            config = (LuceneConfig) indexConf.getCustomIndexSpec(LuceneIndex.ID);

        getTerms();
        nodesWithMatch = new TreeMap<>();
        /* Check if an index is defined on an ancestor of the current node.
        * If yes, scan the ancestor to get the offset of the first character
View Full Code Here

        for (final Iterator<Collection> i = contextSequence.getCollectionIterator(); i.hasNext(); ) {
            final Collection collection = i.next();
            if (collection.getURI().startsWith(XmldbURI.SYSTEM_COLLECTION_URI)) {
                continue;
            }
            IndexSpec idxConf = collection.getIndexConfiguration(context.getBroker());
            if (idxConf != null) {
                final RangeIndexConfig config = (RangeIndexConfig) idxConf.getCustomIndexSpec(RangeIndex.ID);
                if (config != null) {
                    configs.add(config);
                }
            }
        }
View Full Code Here

        for (final Iterator<Collection> i = contextSequence.getCollectionIterator(); i.hasNext(); ) {
            final Collection collection = i.next();
            if (collection.getURI().startsWith(XmldbURI.SYSTEM_COLLECTION_URI)) {
                continue;
            }
            IndexSpec idxConf = collection.getIndexConfiguration(context.getBroker());
            if (idxConf != null) {
                RangeIndexConfig config = (RangeIndexConfig) idxConf.getCustomIndexSpec(RangeIndex.ID);
                if (config != null) {
                    RangeIndexConfigElement rice = config.find(path);
                    if (rice != null && !rice.isComplex()) {
                        return rice;
                    }
View Full Code Here

    public void setDocument(DocumentImpl document) {
        isDocumentGMLAware = false;
        documentDeleted= false;
        if (document != null) {
            IndexSpec idxConf = document.getCollection().getIndexConfiguration(getBroker());
            if (idxConf != null) {
                Map collectionConfig = (Map) idxConf.getCustomIndexSpec(AbstractGMLJDBCIndex.ID);
                if (collectionConfig != null) {
                    isDocumentGMLAware = true;
                    if (collectionConfig.get(AbstractGMLJDBCIndex.ID) != null)
                        flushAfter = ((GMLIndexConfig)collectionConfig.get(AbstractGMLJDBCIndex.ID)).getFlushAfter();
                }
View Full Code Here

            LOG.debug("Dropped " + nodeCount + " nodes from GML index");
    }

    public void removeCollection(Collection collection, DBBroker broker, boolean reindex) {
        boolean isCollectionGMLAware = false;
        IndexSpec idxConf = collection.getIndexConfiguration(broker);
        if (idxConf != null) {
            Map collectionConfig = (Map) idxConf.getCustomIndexSpec(AbstractGMLJDBCIndex.ID);
            isCollectionGMLAware = (collectionConfig != null);
        }
        if (!isCollectionGMLAware)
            return;
View Full Code Here

        for (final Iterator<Collection> i = contextSequence.getCollectionIterator(); i.hasNext(); ) {
            final Collection collection = i.next();
            if (collection.getURI().startsWith(XmldbURI.SYSTEM_COLLECTION_URI)) {
                continue;
            }
            IndexSpec idxConf = collection.getIndexConfiguration(context.getBroker());
            if (idxConf != null) {
                RangeIndexConfig config = (RangeIndexConfig) idxConf.getCustomIndexSpec(RangeIndex.ID);
                if (config != null) {
                    int type = config.getType(field);
                    if (type != Type.ITEM) {
                        return type;
                    }
View Full Code Here

    }

    @Override
    public void setDocument(DocumentImpl document, int mode) {
        this.currentDoc = document;
        IndexSpec indexConf = document.getCollection().getIndexConfiguration(broker);
        if (indexConf != null) {
            config = (RangeIndexConfig) indexConf.getCustomIndexSpec(RangeIndex.ID);
            if (config != null)
                // Create a copy of the original RangeIndexConfig (there's only one per db instance),
                // so we can safely work with it.
                config = new RangeIndexConfig(config);
        }
View Full Code Here

     * or qname should be specified.
     */
    private Analyzer getAnalyzer(QName qname, String fieldName, DocumentSet docs) {
        for (Iterator<Collection> i = docs.getCollectionIterator(); i.hasNext(); ) {
            Collection collection = i.next();
            IndexSpec idxConf = collection.getIndexConfiguration(broker);
            if (idxConf != null) {
                RangeIndexConfig config = (RangeIndexConfig) idxConf.getCustomIndexSpec(RangeIndex.ID);
                if (config != null) {
                    Analyzer analyzer = config.getAnalyzer(qname, fieldName);
                    if (analyzer != null)
                        return analyzer;
                }
View Full Code Here

     * or qname should be specified.
     */
    private boolean isCaseSensitive(QName qname, String fieldName, DocumentSet docs) {
        for (Iterator<Collection> i = docs.getCollectionIterator(); i.hasNext(); ) {
            Collection collection = i.next();
            IndexSpec idxConf = collection.getIndexConfiguration(broker);
            if (idxConf != null) {
                RangeIndexConfig config = (RangeIndexConfig) idxConf.getCustomIndexSpec(RangeIndex.ID);
                if (config != null && !config.isCaseSensitive(qname, fieldName)) {
                    return false;
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.exist.storage.IndexSpec

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.