Package org.exist.storage

Examples of org.exist.storage.IndexSpec


     */
    private List<QName> getDefinedIndexes(DBBroker broker, DocumentSet docs) {
        List<QName> indexes = new ArrayList<QName>(20);
        for (Iterator<Collection> i = docs.getCollectionIterator(); i.hasNext(); ) {
            Collection collection = i.next();
            IndexSpec idxConf = collection.getIndexConfiguration(broker);
            if (idxConf != null) {
                Map<?,?> config = (Map<?,?>) idxConf.getCustomIndexSpec(NGramIndex.ID);
                if (config != null) {
                    for (Object name : config.keySet()) {
                        QName qn = (QName) name;
                        indexes.add(qn);
                    }
View Full Code Here


    @Override
    public StoredNode getReindexRoot(StoredNode node, NodePath path, boolean insert, boolean includeSelf) {
        if (node.getNodeType() == Node.ATTRIBUTE_NODE)
            return null;
        IndexSpec indexConf = node.getDocument().getCollection().getIndexConfiguration(broker);
        if (indexConf != null) {
            Map<?,?> config = (Map<?,?>) indexConf.getCustomIndexSpec(NGramIndex.ID);
            if (config == null)
                return null;
            boolean reindexRequired = false;
            int len = node.getNodeType() == Node.ELEMENT_NODE && !includeSelf ? path.length() - 1 : path.length();
            for (int i = 0; i < len; i++) {
View Full Code Here

    @Override
    public void setDocument(DocumentImpl document, int newMode) {
      currentDoc = document;
        //config = null;
        contentStack = null;
        IndexSpec indexConf = document.getCollection().getIndexConfiguration(broker);
        if (indexConf != null)
            config = (Map<QName, ?>) indexConf.getCustomIndexSpec(org.exist.indexing.ngram.NGramIndex.ID);
        mode = newMode;
    }
View Full Code Here

    }

    public void setDocument(DocumentImpl doc, int newMode) {
        document = doc;
        mode = newMode;
        final IndexSpec indexConf = document.getCollection().getIndexConfiguration(broker);
        if (indexConf != null)
            {config = indexConf.getFulltextIndexSpec();}
        engine.setDocument(document);
    }
View Full Code Here

    }

    public StoredNode getReindexRoot(StoredNode node, NodePath path, boolean insert, boolean includeSelf) {
        if (node.getNodeType() == Node.ATTRIBUTE_NODE)
            {return null;}
        final IndexSpec indexConf = node.getDocument().getCollection().getIndexConfiguration(broker);
        if (indexConf != null) {
            final FulltextIndexSpec config = indexConf.getFulltextIndexSpec();
            if (config == null)
                {return null;}
            boolean reindexRequired = false;
            final int len = node.getNodeType() == Node.ELEMENT_NODE && !includeSelf ? path.length() - 1 : path.length();
            for (int i = 0; i < len; i++) {
View Full Code Here

        // index settings
        final NodeList cl = doc.getElementsByTagName( Indexer.CONFIGURATION_INDEX_ELEMENT_NAME );

        if( cl.getLength() > 0 ) {
            final Element   elem = (Element)cl.item( 0 );
            final IndexSpec spec = new IndexSpec( null, elem );
            config.put( Indexer.PROPERTY_INDEXER_CONFIG, spec );
            //LOG.debug(Indexer.PROPERTY_INDEXER_CONFIG + ": " + config.get(Indexer.PROPERTY_INDEXER_CONFIG));
        }

        // index modules
View Full Code Here

     */
    private QName[] getDefinedIndexes(DBBroker broker, DocumentSet docs) {
        final Set<QName> indexes = new HashSet<QName>();
        for (final Iterator<org.exist.collections.Collection> i = docs.getCollectionIterator(); i.hasNext(); ) {
            final org.exist.collections.Collection collection = i.next();
            final IndexSpec idxConf = collection.getIndexConfiguration(broker);
            if (idxConf != null) {
                final List<QName> qnames = idxConf.getIndexedQNames();
                for (int j = 0; j < qnames.size(); j++) {
                    final QName qName = (QName) qnames.get(j);
                    indexes.add(qName);
                }
            }
View Full Code Here

     */
    private QName[] getDefinedIndexes(DBBroker broker, DocumentSet docs) {
        final Set<QName> indexes = new HashSet<QName>();
        for (final Iterator<org.exist.collections.Collection> i = docs.getCollectionIterator(); i.hasNext(); ) {
            final org.exist.collections.Collection collection = i.next();
            final IndexSpec idxConf = collection.getIndexConfiguration(broker);
            if (idxConf != null) {
                final FulltextIndexSpec fIdxConf = idxConf.getFulltextIndexSpec();
                final List<QName> qnames = fIdxConf.getIndexedQNames();
                for (final QName qName : qnames) {
                    indexes.add(qName);
                }
            }
View Full Code Here

                    }
                } else if (INDEX_ELEMENT.equals(node.getLocalName())) {
                    final Element elem = (Element) node;
                    try {
                        if (indexSpec == null)
                            {indexSpec = new IndexSpec(broker, elem);}
                        else
                            {indexSpec.read(broker, elem);}
                    } catch (final DatabaseConfigurationException e) {
                        if (checkOnly)
                            {throw new CollectionConfigurationException(e.getMessage(), e);}
View Full Code Here

            public List<Object> call() throws Exception {

                List<Object> configs = new ArrayList<Object>(10);

                for (CollectionConfiguration config: configurations.values()) {
                    IndexSpec spec = config.getIndexConfiguration();
                    if (spec != null) {
                        Object customConfig = spec.getCustomIndexSpec(customIndexId);
                        if (customConfig != null) {
                            configs.add(customConfig);
                        }
                    }
                }
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.