use of org.exist.storage.IndexSpec in project exist by eXist-db.
the class AbstractGMLJDBCIndexWorker method setDocument.
@Override
public void setDocument(DocumentImpl document) {
isDocumentGMLAware = false;
documentDeleted = false;
if (document != null) {
IndexSpec idxConf = document.getCollection().getIndexConfiguration(getBroker());
if (idxConf != null) {
final 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();
}
}
}
if (isDocumentGMLAware) {
currentDoc = document;
} else {
currentDoc = null;
currentMode = ReindexMode.UNKNOWN;
}
}
use of org.exist.storage.IndexSpec in project exist by eXist-db.
the class Lookup method findConfiguration.
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;
}
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;
}
}
}
}
return null;
}
use of org.exist.storage.IndexSpec in project exist by eXist-db.
the class NGramIndexWorker method setDocument.
@Override
public void setDocument(final DocumentImpl document, final ReindexMode newMode) {
currentDoc = document;
// config = null;
while (!contentStack.isEmpty()) {
contentStack.pop().reset();
}
final IndexSpec indexConf = document.getCollection().getIndexConfiguration(broker);
if (indexConf != null) {
config = (Map<QName, ?>) indexConf.getCustomIndexSpec(org.exist.indexing.ngram.NGramIndex.ID);
}
mode = newMode;
}
use of org.exist.storage.IndexSpec in project exist by eXist-db.
the class RangeIndexWorker method isCaseSensitive.
/**
* Return the analyzer to be used for the given field or qname. Either field
* 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;
}
}
}
return true;
}
use of org.exist.storage.IndexSpec in project exist by eXist-db.
the class RangeIndexWorker method setDocument.
@Override
public void setDocument(DocumentImpl document, ReindexMode 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);
} else {
config = RangeIndexConfig.DEFAULT_CONFIG;
}
this.mode = mode;
}
Aggregations