use of org.apache.jackrabbit.oak.plugins.index.lucene.IndexDefinition.IndexingRule in project jackrabbit-oak by apache.
the class IndexDefinitionTest method propertyDefinitionWithExcludes.
@Test
public void propertyDefinitionWithExcludes() throws Exception {
builder.child(PROP_NODE).child("foo").setProperty(LuceneIndexConstants.PROP_TYPE, PropertyType.TYPENAME_DATE);
IndexDefinition idxDefn = new IndexDefinition(root, builder.getNodeState(), "/foo");
IndexingRule rule = idxDefn.getApplicableIndexingRule(NT_BASE);
assertTrue(rule.isIndexed("foo"));
assertTrue(rule.isIndexed("bar"));
assertEquals(PropertyType.DATE, rule.getConfig("foo").getType());
}
use of org.apache.jackrabbit.oak.plugins.index.lucene.IndexDefinition.IndexingRule in project jackrabbit-oak by apache.
the class IndexDefinitionTest method skipTokenization.
@Test
public void skipTokenization() throws Exception {
NodeBuilder rules = builder.child(INDEX_RULES);
rules.child("nt:folder");
TestUtil.child(rules, "nt:folder/properties/prop2").setProperty(LuceneIndexConstants.PROP_NAME, ".*").setProperty(LuceneIndexConstants.PROP_IS_REGEX, true).setProperty(LuceneIndexConstants.PROP_ANALYZED, true);
IndexDefinition defn = new IndexDefinition(root, builder.getNodeState(), "/foo");
IndexingRule rule = defn.getApplicableIndexingRule(asState(newNode("nt:folder")));
assertFalse(rule.getConfig("foo").skipTokenization("foo"));
assertTrue(rule.getConfig(JcrConstants.JCR_UUID).skipTokenization(JcrConstants.JCR_UUID));
}
Aggregations