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.
Solved! Go to Solution.
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
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
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.
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!
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.