Alfresco 在特定内容模型上禁用全文索引
Alfresco disable full text indexing on specific content model
使用 Alfresco 4.2 或 5.0,如何禁用基于内容模型的全文索引?
这是一个内容模型示例,您具体更改了什么(即,在没有实际使用内容模型的情况下,不要引用索引控制方面)。
<model name="my:textdoc" xmlns="http://www.alfresco.org/model/dictionary/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<imports>
<import prefix="d" uri="http://www.alfresco.org/model/dictionary/1.0" />
<import prefix="cm" uri="http://www.alfresco.org/model/content/1.0" />
</imports>
<namespaces>
<namespace prefix="my"
uri="http://www.notarealurl.xyz/model/my/1.0" />
</namespaces>
<types>
<type name="my:securetextdoc">
<title>text docs with keyword searching, but not content searching</title>
<parent>cm:content</parent>
<properties>
<property name="my:securekeywords">
<title>custom key word text field</title>
<type>d:text</type>
<mandatory>true</mandatory>
</property>
</properties>
<mandatory-aspects>
<!-- <aspect>cm:dublincore</aspect> -->
<aspect>cm:versionable</aspect>
</mandatory-aspects>
</type>
</types>
最终答案
<model name="my:textdoc" xmlns="http://www.alfresco.org/model/dictionary/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<imports>
<import prefix="d" uri="http://www.alfresco.org/model/dictionary/1.0" />
<import prefix="cm" uri="http://www.alfresco.org/model/content/1.0" />
</imports>
<namespaces>
<namespace prefix="my"
uri="http://www.notarealurl.xyz/model/my/1.0" />
</namespaces>
<types>
<type name="my:securetextdoc">
<title>text docs with keyword searching, but not content searching</title>
<parent>cm:content</parent>
<properties>
<property name="my:securekeywords">
<title>custom key word text field</title>
<type>d:text</type>
<mandatory>true</mandatory>
</property>
</properties>
<mandatory-aspects>
<!-- <aspect>cm:dublincore</aspect> -->
<aspect>my:doNotIndexContentControl</aspect>
<aspect>cm:versionable</aspect>
</mandatory-aspects>
</type>
</types>
<aspects>
<aspect name="my:doNotIndexContentControl">
<title>Do Not Index Control</title>
<parent>cm:indexControl</parent>
<overrides>
<property name="cm:isIndexed">
<default>true</default>
</property>
<property name="cm:isContentIndexed">
<default>false</default>
</property>
</overrides>
</aspect>
</aspects>
</model>
重要说明:如果您收到 "Source node class has no callback" 错误,这与更改内容模型然后尝试更新(可能是可版本化的)现有内容有关。没有已知的解决方法,但这与索引控制选项无关。
Data Dictionary guide on the Alfresco wiki
中对此进行了介绍
您需要做的就是对您的模型进行以下操作:
<index enabled="false" />
如果您查看类似 Alfresco system model 的内容,您会看到几个这样的例子
您可以通过定义一个扩展 cm:indexControl
的新方面来实现这一点,如下所示:
<aspect name="my:doNotIndexContentControl">
<title>Do Not Index Control</title>
<parent>cm:indexControl</parent>
<overrides>
<property name="cm:isIndexed">
<default>true</default>
</property>
<property name="cm:isContentIndexed">
<default>false</default>
</property>
</overrides>
</aspect>
注意覆盖。覆盖的 属性、cm:isContentIndexed
,默认值设置为 false
是关键。
然后,您可以将此方面添加为您不希望对内容进行全文索引的类型的必填项。 cm:indexControl
的完整配置选项可以在文档 http://docs.alfresco.com/4.2/concepts/admin-indexes.html
中找到
此外,如果您有已编入索引的现有内容项,并且您希望这些文档不再被编入索引,您将需要进行完整的重新索引。
使用 Alfresco 4.2 或 5.0,如何禁用基于内容模型的全文索引?
这是一个内容模型示例,您具体更改了什么(即,在没有实际使用内容模型的情况下,不要引用索引控制方面)。
<model name="my:textdoc" xmlns="http://www.alfresco.org/model/dictionary/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<imports>
<import prefix="d" uri="http://www.alfresco.org/model/dictionary/1.0" />
<import prefix="cm" uri="http://www.alfresco.org/model/content/1.0" />
</imports>
<namespaces>
<namespace prefix="my"
uri="http://www.notarealurl.xyz/model/my/1.0" />
</namespaces>
<types>
<type name="my:securetextdoc">
<title>text docs with keyword searching, but not content searching</title>
<parent>cm:content</parent>
<properties>
<property name="my:securekeywords">
<title>custom key word text field</title>
<type>d:text</type>
<mandatory>true</mandatory>
</property>
</properties>
<mandatory-aspects>
<!-- <aspect>cm:dublincore</aspect> -->
<aspect>cm:versionable</aspect>
</mandatory-aspects>
</type>
</types>
最终答案
<model name="my:textdoc" xmlns="http://www.alfresco.org/model/dictionary/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<imports>
<import prefix="d" uri="http://www.alfresco.org/model/dictionary/1.0" />
<import prefix="cm" uri="http://www.alfresco.org/model/content/1.0" />
</imports>
<namespaces>
<namespace prefix="my"
uri="http://www.notarealurl.xyz/model/my/1.0" />
</namespaces>
<types>
<type name="my:securetextdoc">
<title>text docs with keyword searching, but not content searching</title>
<parent>cm:content</parent>
<properties>
<property name="my:securekeywords">
<title>custom key word text field</title>
<type>d:text</type>
<mandatory>true</mandatory>
</property>
</properties>
<mandatory-aspects>
<!-- <aspect>cm:dublincore</aspect> -->
<aspect>my:doNotIndexContentControl</aspect>
<aspect>cm:versionable</aspect>
</mandatory-aspects>
</type>
</types>
<aspects>
<aspect name="my:doNotIndexContentControl">
<title>Do Not Index Control</title>
<parent>cm:indexControl</parent>
<overrides>
<property name="cm:isIndexed">
<default>true</default>
</property>
<property name="cm:isContentIndexed">
<default>false</default>
</property>
</overrides>
</aspect>
</aspects>
</model>
重要说明:如果您收到 "Source node class has no callback" 错误,这与更改内容模型然后尝试更新(可能是可版本化的)现有内容有关。没有已知的解决方法,但这与索引控制选项无关。
Data Dictionary guide on the Alfresco wiki
中对此进行了介绍您需要做的就是对您的模型进行以下操作:
<index enabled="false" />
如果您查看类似 Alfresco system model 的内容,您会看到几个这样的例子
您可以通过定义一个扩展 cm:indexControl
的新方面来实现这一点,如下所示:
<aspect name="my:doNotIndexContentControl">
<title>Do Not Index Control</title>
<parent>cm:indexControl</parent>
<overrides>
<property name="cm:isIndexed">
<default>true</default>
</property>
<property name="cm:isContentIndexed">
<default>false</default>
</property>
</overrides>
</aspect>
注意覆盖。覆盖的 属性、cm:isContentIndexed
,默认值设置为 false
是关键。
然后,您可以将此方面添加为您不希望对内容进行全文索引的类型的必填项。 cm:indexControl
的完整配置选项可以在文档 http://docs.alfresco.com/4.2/concepts/admin-indexes.html
此外,如果您有已编入索引的现有内容项,并且您希望这些文档不再被编入索引,您将需要进行完整的重新索引。