10-18-2018 08:49 AM
Using Alfresco Community - 5.0.0 version.
Below query using Solr returned result :
1st Query : select cmisbjectId from TEST:doc where TEST:docType = 'Type1'
But we want the case-insensitive search if there are docType value 'type1' || 'TYPE1' || 'tYpe1' || 'Type1' then it should give same number of records.
I've tried below query which works fine while "Trying DB query DbOrIndexSwitchingQueryLanguage" fetch,
but "Using SOLR query DbOrIndexSwitchingQueryLanguage" not returning any result for the same query.
2nd Query: select cmisbjectId from TEST:doc where LOWER(TEST:docType) = 'type1'
But while using LOWER it's execution time is much higher. For example, if the 1st query takes 10ms then 2nd takes around 3 seconds.
What is the syntax to search in Solr case insensitive or is there another way to resolve this performance issue?
10-18-2018 09:26 AM
Have you tried "CONTAINS" clause instead of "LOWER"?
10-18-2018 09:47 AM
Wanna do exact string search but case-insensitive, contains will lead to wrong results.
10-18-2018 09:59 AM
IMO first query is giving you all required results and it's case-insensitive, but probably I'm wrong.
10-18-2018 10:04 AM
If you want to query for case insensitive matches, your best bet is probably using FTS query language instead of CMIS. Though bear in mind that for FTS as well can by definition not achieve both at the same time (exact + insensitive match), but for different reasons. If you don't specify exact match per query modifier, you will get case insensitive matches, but due to tokenisation and stemming you may also get matches for slightly different values (i.e. "motor" vs. "motors").
Effectively, unless you start writing custom, special purpose SQL queries without using the standardised query languages, you will likely not be able to achieve 100% of what you want.
10-21-2018 11:42 PM
Cross-posted here: How to Query case insensitive in Alfresco Solr search? - Stack Overflow.
Explore our Alfresco products with the links below. Use labels to filter content by product module.