10-04-2018 05:32 AM
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.
10-04-2018 05:56 AM
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
10-04-2018 05:56 AM
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
10-04-2018 06:05 AM
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.
10-04-2018 06:39 AM
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.
10-04-2018 11:43 AM
ok, i got it from your answer. replacing
cmis:name like 'aaa%'
withCONTAINS('cmis:name:aaa')
now also finds documents having a filename with "AAA". that's the desired result.
thank you!
Explore our Alfresco products with the links below. Use labels to filter content by product module.