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

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Active Member

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

Jump to solution

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.

1 Solution

Accepted Solutions
Highlighted
Alfresco Employee

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

Jump to solution

Did you follow Step 3 (cross-language) to configure your SOLR 6?

Installing and configuring Search Services without SSL | Alfresco Documentation 

Software Engineer in Alfresco Search Team.

View solution in original post

8 Replies
Highlighted
Alfresco Employee

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

Jump to solution

Probably the results are different because SOLR is not considering permissions.

Software Engineer in Alfresco Search Team.
Highlighted
Active Member

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

Jump to solution

Hi,

I'm connecting with the "admin" user.

The document, has the following permissions:

  • inherited: Everyone=Consumer
  • has no locally set permissions
Highlighted
Alfresco Employee

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

Jump to solution

As I said, SOLR is not considering permissions.

Software Engineer in Alfresco Search Team.
Highlighted
Active Member

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

Jump to solution

Hi Angel,

I don't understand your response.

If SOLR is returning results and I know that at least one of them is accessible by me, why I'm not seing this result?

Jordi.

Highlighted
Alfresco Employee

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

Jump to solution

If I understood right...

You get 1 result when using Search APIs (CMIS / FTS)

You get 10 results when querying directly SOLR

What makes sense, as SOLR does not check permissions and returns all the results in Alfresco Repository.

Am I missing something?

Software Engineer in Alfresco Search Team.
Highlighted
Active Member

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

Jump to solution

Not exactly.

This is the situation:

I have 1 document with AP_TITOL = "Llach treu una nova novel· la". User "admin" can see it (from Alfresco Share).

When querying SOLR directly, this document is in the list.

But when user "admin" queries by CMIS with CONTAINS no document is returned.

From my perspective, what should happen is: SOLR returns some documents , then Alfresco applies security and some documents may be discarted, but the Document I mentioned before should not be discarted because "admin" has permission to see it.

Other facts:

If "admin" performs a CMIS relational query (without CONTAINS), the document is returned.

After your last answer, I've found that when querying SOLR directly, it returns all the documents of my custom type, it seems to ignore my CONTAINS clause!!

Jordi.

Highlighted
Alfresco Employee

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

Jump to solution

Did you follow Step 3 (cross-language) to configure your SOLR 6?

Installing and configuring Search Services without SSL | Alfresco Documentation 

Software Engineer in Alfresco Search Team.

View solution in original post

Highlighted
Active Member

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

Jump to solution

You were right.

After enabling cross-language in solr, restarting servers and reindexing documents, I'm able to find the documents with CMIS AFS.

Thank you Angel!