使用 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>
Run Code Online (Sandbox Code Playgroud)
最终答案
<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>
Run Code Online (Sandbox Code Playgroud)
重要说明:如果您收到“源节点类没有回调”错误,这与更改内容模型然后尝试更新(可能是可版本化的)现有内容有关。没有已知的解决方法,但这与索引控制选项无关。
您可以通过定义一个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>
Run Code Online (Sandbox Code Playgroud)
注意覆盖。被覆盖的属性 ,cm:isContentIndexed默认值设置false为 key。
然后,您将此方面添加为您不希望对内容进行全文索引的类型的强制性要求。完整的配置选项cm:indexControl可以在文档http://docs.alfresco.com/4.2/concepts/admin-indexes.html 中找到
此外,如果您有已编入索引的现有内容项,并且您希望不再为这些文档编入索引,则需要执行完整的重新索引。
| 归档时间: |
|
| 查看次数: |
1874 次 |
| 最近记录: |