【问题标题】:How to create a custom filter in Alfresco?如何在 Alfresco 中创建自定义过滤器?
【发布时间】:2020-04-28 02:11:04
【问题描述】:

我使用的是露天企业 6.0。我想创建一个基于自定义方面的自定义方面过滤器。我创建了一个看起来像这样的自定义模型。

<?xml version="1.0" encoding="UTF-8"?>
<model name="tm:contentModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

<imports>
    <!-- Import Alfresco Dictionary Definitions -->
    <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
    <!-- Import Alfresco Content Domain Model Definitions -->
    <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
    <!-- Import Alfresco System Model Definitions -->
    <import uri="http://www.alfresco.org/model/system/1.0" prefix="sys"/>
</imports>

<namespaces>
    <namespace uri="http://www.test.com/model/mymodel/1.0" prefix="tm"/>
</namespaces>

<aspects>        
    <aspect name="tm:myvaluea">
        <title>Test Property</title>
        <properties>
            <property name="tm:myvalueb">
                <title>Test Property</title>
                <type>d:text</type>
                <index enabled="true">
                  <atomic>true</atomic>
                  <tokenised>false</tokenised>
                </index>
            </property>
        </properties>
    </aspect>          
</aspects>
</model>

按照此文档https://docs.alfresco.com/6.0/tasks/filtered-search-custom.html,我创建了solr-facets-config-custom.properties 文件,该文件具有以下内容。

#Test
custom.tm\:myvalueb.filterID=filter_test
custom.tm\:myvalueb.displayName=Test
custom.tm\:myvalueb.displayControl=alfresco/search/FacetFilters
custom.tm\:myvalueb.maxFilters=3
custom.tm\:myvalueb.hitThreshold=1
custom.tm\:myvalueb.minFilterValueLength=2
custom.tm\:myvalueb.sortBy=DESCENDING
custom.tm\:myvalueb.scope=ALL
custom.tm\:myvalueb.scopedSites=
custom.tm\:myvalueb.isEnabled=true

在多面搜索filter by 列中,它显示如下截图所示。我在属性值前面有undefined。不知道为什么会出现undefined。我是否必须进行任何其他配置或自定义才能使此自定义过滤器正常工作?

【问题讨论】:

    标签: alfresco alfresco-share alfresco-enterprise


    【解决方案1】:

    如果您想在文本字段上创建搜索方面,为什么不使用搜索管理器呢?这样您就不必担心配置文件,并且无需重新启动即可对其进行设置、测试和调整。

    【讨论】:

      猜你喜欢
      • 2019-04-04
      • 2012-04-30
      • 1970-01-01
      • 1970-01-01
      • 2021-07-09
      • 2015-04-12
      • 2015-09-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多