Monday, April 7, 2014

OBIEE - Changing the search defaults to contains and no Match Case

This post (done on obiee 11.1.1.7.140114) describes how to change the the search default from "Srarts" to "Contains" and un-check the Match Case mark (as default).

This week 2 different customers requested the same: changing the search default to "Contains" with Match Case not marked. 
For example, this is the default:


Searching 'POD' will return nothing in default case but will work in the requested case.


The change, while possible is not desirable and I'm not sure it's supported.
It was described in the following blogs:
  • Changing the default to Contains is in OBIEE Eklavya blog (kalpesh-obiee-eklavya.blogspot.com) here. (the second part, the first is for OBIEE 10).
  • Removing the mark is described in the blog Oracle BI in Russian (obi2ru.blogspot.com) here. (Regarding this option, the changing in nqsconfig.ini of CASE_SENSITIVE_CHARACTER_COMPARISON = ON; to OFF, influences the sort rather than search, so not relevant in this case).
To summarize (see detailed instructions in the original blogs) you have to modify 2 java script file. Backup and causation are important. 
Remember that the files will be replaced in future patches. In those cases it's better to repeat the change rather that placing backup files, since the files might change as part of the patch.
Be aware, in one example, not so careful change of this sort, caused the Subject Area content to be empty in Answers. Not ideal situation. 

When you backup, if you do it by copy/paste in the same folder. please change the file extension. As a rule of thumb, don't leave unnecessary .js and .xml files in OBIEE installation.

To change the search from "Starts" to "Contains" we need to change their order in 2 files: 
  • MiddleWareHOME\user_projects\domains\bifoundation_domain\servers\bi_server1\tmp\_WL_user\analytics_11.1.1\7dezjl\war\res\b_mozilla\common\availabledatabrowser.js
  • MiddleWareHOME\user_projects\domains\bifoundation_domain\servers\bi_server1\tmp\_WL_user\analytics_11.1.1\7dezjl\war\res\b_mozilla\uicomponents\obips.DropDown\obips.dropdownsearchdialog.js
On my machine those are the files:
  • D:\or\MWHOME\user_projects\domains\bifoundation_domain\servers\bi_server1\tmp\_WL_user\analytics_11.1.1\7dezjl\war\res\b_mozilla\common\availabledatabrowser.js
  •  D:\or\MWHOME\user_projects\domains\bifoundation_domain\servers\bi_server1\tmp\_WL_user\analytics_11.1.1\7dezjl\war\res\b_mozilla\uicomponents\obips.DropDown\obips.dropdownsearchdialog.js
* I'm not sure the first file change is needed.  Changing only obips.dropdownsearchdialog.js seems to do the work. I'm still investigating.

In both* replace (DO NOT copy / paste from here, it's not a working code)
var d=new Array();
d.push(newobips.FormFields.Option(obiprp.PromptComponents.Utilities.getPromptResource
("kmsgSearchStringStarts").getString(),"beginsWith"));
d.push(newobips.FormFields.Option(obiprp.PromptComponents.Utilities.getPromptResource
("kmsgSearchStringContains").getString(),"contains"));

With 
var d=new Array();
d.push(newobips.FormFields.Option(obiprp.PromptComponents.Utilities.getPromptResource
("kmsgSearchStringContains").getString(),"contains"));
d.push(newobips.FormFields.Option(obiprp.PromptComponents.Utilities.getPromptResource
("kmsgSearchStringStarts").getString(),"beginsWith"));

What you actually do is changing the order between
d.push(newobips.FormFields.Option(obiprp.PromptComponents.Utilities.getPromptResource
("kmsgSearchStringStarts").getString(),"beginsWith"));
and
d.push(newobips.FormFields.Option(obiprp.PromptComponents.Utilities.getPromptResource
("kmsgSearchStringContains").getString(),"contains"));

While you are in MiddleWareHOME\user_projects\domains\bifoundation_domain\servers\bi_server1\tmp\_WL_user\analytics_11.1.1\7dezjl\war\res\b_mozilla\uicomponents\obips.DropDown\obips.dropdownsearchdialog.js file,you can also change the Match Case part, as described in obi2ru (DO NOT copy / paste from here, it's not a working code):
{var c=this.bCaseInsensitiveSearch;
var d=this.bCaseInsensitiveSearch;
this.matchCase=new obips.FormFields.Checkbox
("matchCase","matchCase","matchCase",obiprp.PromptComponents.
Utilities.getPromptResource("kmsgSelectionsMatchCase").getString(),d,c);

To 
{var c=this.bCaseInsensitiveSearch;
var d=false;
this.matchCase=new obips.FormFields.Checkbox
("matchCase","matchCase","matchCase",obiprp.PromptComponents.
Utilities.getPromptResource("kmsgSelectionsMatchCase").getString(),d,c);

No need to restart the BI server, but clearing the browser cache might be a good idea (Ctrl+Shift+Del in most browers).

The result is the following default:


10 comments:

  1. Hyderabadsys Obiee online training Every Faculty has Real Time experiance.Trained Resources placed in countries like Australia, USA, UK, JAPAN, SWEDEN etc.Any important problems round-faced by resource resolved victimisation Teamviewer, webex.Supporting the resource with high a hundred Interview queries.Resume inbuilt best company standards in keeping with the work description Obiee online training.
    hyderabadsys.com/obiee-online-training

    ReplyDelete
  2. Hi ,

    You Have Provided Valuable Information on OBIEE and i am much impressed with this information and it is Very useful to OBIEE Learners

    ReplyDelete

  3. It was really a nice article and I was really impressed by reading this article.
    http://www.tekclasses.com/

    ReplyDelete
  4. Good blog,for more deatails please folle the link


    http://www.tekclasses.com/

    ReplyDelete
  5. Excellent Information,for more information please visit the link
    http://www.tekclasses.com/

    ReplyDelete
  6. Very useful really good information.

    http://www.tekclasses.com/

    ReplyDelete
  7. Hi friend,

    Thank you so much for your post it's very useful, but I have a problem with the part to change the option "Contains" instead "Starts". I've replaced the code as you suggested but I don't have success.

    Can you help me?, this is my code that I've used

    var d=new Array();
    d.push(new obips.FormFields.Option(obiprp.PromptComponents.Utilities.getPromptResource("kmsgSearchStringContains").getString(),"contains"));
    d.push(new obips.FormFields.Option(obiprp.PromptComponents.Utilities.getPromptResource("kmsgSearchStringStarts").getString(),"beginsWith"));

    ReplyDelete
  8. Well defined each and every step..
    Visit our site for more details
    http://hungerlion.com/

    ReplyDelete
  9. we are offering best Obiee online training with work support and job assistance and high quality training facilities and well expert faculty
    for other details and register your demo contact
    obiee training in hyderabad

    ReplyDelete
  10. It was really a nice article and I was really impressed by reading this article. OBIEE Online Training

    ReplyDelete