AnsweredAssumed Answered

How to make FTS queries on custom type on Alfresco 6?

Question asked by easy_bd_infra on Mar 27, 2019
Latest reply on Apr 2, 2019 by easy_bd_infra

Hi,

I've configured a custom type on Alfresco 6, but I'm not able to make Full Text Searches on custom fields of the custom type.

 

This is the definition of the field in the "alfresco model manager":

<model xmlns="http://www.alfresco.org/model/dictionary/1.0" name="premsa:ArxiuPremsa">

   ...
    <types>
        <type name="premsa:Noticia">
            <title>AP_Noticia</title>
            <parent>cm:content</parent>
            <properties>
               ...
                <property name="premsa:AP_TITOL">
                    <type>d:text</type>
                    <mandatory>false</mandatory>
                    <index enabled="true">
                        <tokenised>TRUE</tokenised>
                        <facetable>false</facetable>
                    </index>
                    <constraints>
                        <constraint name="premsa:LENGTH_d32b06e3-d845-4337-83be-9dc616d49f20" type="LENGTH">
                            <parameter name="maxLength">
                                <value>500</value>
                            </parameter>
                            <parameter name="minLength">
                                <value>1</value>
                            </parameter>
                        </constraint>
                    </constraints>
                </property>
                  ....

First I've tried to perform the search in Alfresco Share with simple and advanced searches but they find no documents.

 

I'm able to perform transactional queries in CMIS like this one and I get 1 document:

SELECT * FROM premsa:Noticia where premsa:AP_TITOL='Llach treu una nova novel· la'

But I'm unable to find this document using FTS queries in CMIS, for example:

SELECT * FROM premsa:Noticia where contains('\'Llach\'')

SELECT * FROM premsa:Noticia where contains('premsa:AP_TITOL:\'Llach\'')

In SOLR, I've enabled the log level org.solr.client.AbstractQParser to DEBUG. And I see the following in the SOLR log corresponding to the last FTS query:

2019-03-27 08:15:51.162 DEBUG (qtp1528637575-17) [   x:alfresco] o.a.s.q.AbstractQParser AFTS QP query as lucene:           +(TYPE:{http://www.ccma.cat/model/arxiuPremsa/1.0}Noticia) +(_dummy_:Llach text@s__lt@{http://www.ccma.cat/model/arxiuPremsa/1.0}AP_TITOL:{ca}llach)^1000.0

If I perform this Lucene search against SOLR, it retrieves more than 10 results.

Why I'm not seing this results in Alfresco?

 

Thanks,

Jordi.

Outcomes