COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => COGNOS Connection => Topic started by: david.stachon on 08 Apr 2009 05:57:46 PM

Title: Cognos Connection: "Search" (default to "Name or Description")
Post by: david.stachon on 08 Apr 2009 05:57:46 PM
Does anyone know if it's possible to change the "Search" in Cognos Connection to default to searching for: "Name or Description" as opposed to "Name Field". (some users aren't clever enough to change it on there own)

...this is 8.2.

cheers,
david.
Title: Re: Cognos Connection: "Search" (default to "Name or Description")
Post by: prakashraju987 on 13 Apr 2009 06:53:09 AM
This is possible in cognos 8.4.there Direct option is available.
Title: Re: Cognos Connection: "Search" (default to "Name or Description")
Post by: CognosPaul on 16 Apr 2009 08:15:10 AM
You can do this by modifying the internals. I'm using 8.4, but I have no reason to think the 8.2 version will be much different.


open ..\c8\templates\ps\logicsheets\presentation\main\search.xsl

look for this section:

      <out:variable name="field">
         <out:variable name="f" select="string(key('env-param','sfield'))"/>
         <out:choose>
            <out:when test="$singleField != ''"><out:value-of select="$singleField"/></out:when>
            <out:when test="($f = 'k' or $f = '')">
               <out:choose>
                  <out:when test="$indexSearch='true' and $userCanUseIndexSearch">
                     <out:value-of select="'k'"/>
                  </out:when>
                  <out:otherwise>
                     <out:value-of select="'n'"/>
                  </out:otherwise>
               </out:choose>
            </out:when>
            <out:otherwise>
               <out:value-of select="$f"/>
            </out:otherwise>
         </out:choose>
      </out:variable>

change the <out:value-of select="'n'"/> to <out:value-of select="'nd'"/>
Note, single quote inside double quote.

n is for Name
d is for Description
and nd is for Name and Description

I cannot stress enough the importance of backing up any internal file before modifying it! A single misplaced comma will often be enough to prevent Cognos from loading.
Title: Re: Cognos Connection: "Search" (default to "Name or Description")
Post by: david.stachon on 25 Apr 2009 06:20:07 PM
ah brilliant. thanks for that.
Title: Re: Cognos Connection: "Search" (default to "Name or Description")
Post by: afzaki7 on 28 Apr 2016 03:32:08 AM
is that work for cognos 10.2 ? because there is a Full text and all fields option
what i really want is to set the Name field option as the default selection instead of  Full text and all fields option
Title: Re: Cognos Connection: "Search" (default to "Name or Description")
Post by: CogYess on 06 Dec 2018 12:47:02 AM
This doesn't seem to work for Cognos 10.2 , anyone any idea how to change the Default Search to "Name or Description" in Cognos 10.2 ?