cancel
Showing results for 
Search instead for 
Did you mean: 

CMIS Search by cmis:name and cmis:description case insensitive?

robobot
Champ in-the-making
Champ in-the-making

Hi there,

we are using the alfresco community version 5.2 and we are trying to perform a case insensitive search on the two standard properties cmis:name and cmis:description. Actually when searching for "AAA" only files named "AAA" will be found, not files named "aaa" or "Aaa".

In other threads and questions we figured out, that we have to configure this bevahiour in alfrescos schema.xml.

we add the following entries:

  <!-- LowerCaseFilter for name-->

  <fieldType name="name" class="solr.TextField">         
         <analyzer type="index">
            <tokenizer class="solr.WhitespaceTokenizerFactory"/>
            <filter class="solr.LowerCaseFilterFactory"/>
        </analyzer>
        <analyzer type="query">
            <tokenizer class="solr.WhitespaceTokenizerFactory"/>
            <filter class="solr.LowerCaseFilterFactory"/>
        </analyzer>
      </fieldType>
      
      <!-- LowerCaseFilter for description -->
      <fieldType name="description" class="solr.TextField">         
         <analyzer type="index">
            <tokenizer class="solr.WhitespaceTokenizerFactory"/>
            <filter class="solr.LowerCaseFilterFactory"/>
        </analyzer>
        <analyzer type="query">
            <tokenizer class="solr.WhitespaceTokenizerFactory"/>
            <filter class="solr.LowerCaseFilterFactory"/>
        </analyzer>
      </fieldType>

After performing a full re-index this entry doesn't seem to have any effect.

How can we change/configure the entries to match our requirement?

Any hints are very appreciated. Thanks in advance.

1 ACCEPTED ANSWER

angelborroy
Community Manager Community Manager
Community Manager

CMIS has no support for insensitive search terms. Modifications in SOLR Model have no effect on your searching results.

You could change to FTS syntax by including the CONTAINS clause in your CMIS query, but tokenisation will be applied and probably you'll find additional results.

Some sample queries using out-of-the-box Alfresco SWSDP sample site:

SELECT * FROM cmis:document WHERE cmis:name like 'meeting%'
0 results

SELECT * FROM cmis:document WHERE CONTAINS('cmis:name:meeting*')
4 results
Hyland Developer Evangelist

View answer in original post

4 REPLIES 4

angelborroy
Community Manager Community Manager
Community Manager

CMIS has no support for insensitive search terms. Modifications in SOLR Model have no effect on your searching results.

You could change to FTS syntax by including the CONTAINS clause in your CMIS query, but tokenisation will be applied and probably you'll find additional results.

Some sample queries using out-of-the-box Alfresco SWSDP sample site:

SELECT * FROM cmis:document WHERE cmis:name like 'meeting%'
0 results

SELECT * FROM cmis:document WHERE CONTAINS('cmis:name:meeting*')
4 results
Hyland Developer Evangelist

robobot
Champ in-the-making
Champ in-the-making

Thanks for your respone,

but how does alfresco handle case insensitive search then? If i type "AAA" in alfrescos search field (Webapplication), files named "aaa" will also be returned.

You can use FTS syntax to define your query.

=cm:name:'Meeting*'

This will include only documents starting exactly with that case combination. 

Using searching box in Web Application, applies default searching parameters, what can't fit your expectations.

Hyland Developer Evangelist

robobot
Champ in-the-making
Champ in-the-making

ok, i got it from your answer. replacing

cmis:name like 'aaa%'

with
CONTAINS('cmis:name:aaa')

now also finds documents having a filename with "AAA". that's the desired result.

thank you!