[xwiki-users] xwiki case sensitive search

Esbach, Brandon Esbachb at tycoelectronics.com
Tue Aug 28 10:33:30 CEST 2007


My guess is that you're using PostgreSQL, or something similar with
case-sensitive search by default?  Usually "like" is case insensitive.
If it is PostgreSQL, you could use "ilike" in place of "like" will work
for case insensitive search, otherwise (better solution) just set both
strings to uppercase (UPPERCASE() or UCASE() is the syntax I think,
check he Hibernate documentation if either won't work).

I had thought this was resolved back in March though?

-----Original Message-----
From: anujssharma86 at yahoo.co.in [mailto:anujssharma86 at yahoo.co.in] 
Sent: 28 August 2007 06:01
To: xwiki-users at objectweb.org
Subject: [xwiki-users] xwiki case sensitive search

Hi,

I am working on XWiki. Presently the search tool for searching in
attachment contents is case sensitive .If I want to make it case
insensitive, what changes I have to make in its code.

 

Here is the code for attachment content search in xwiki.

 

Search in attachment file content

 

#set($sql= ", XWikiAttachment attach, XWikiAttachmentContent as attachc
where doc.id = attach.docId and attach.id = attachc.id and
attachc.content like '%$text%' ")     

 

#foreach ( $item in $xwiki.searchDocuments($sql , $nb , $start)) 

 

#if ($xwiki.hasAccessLevel("view", $context.user,
"${context.database}:${item}")) 

 

#set($bentrydoc = $xwiki.getDocument($item)) *
[$bentrydoc.name>${bentrydoc.web}.$bentrydoc.name] by        

        $xwiki.getLocalUserName($bentrydoc.author) on
$xwiki.formatDate($bentrydoc.date, $formatDate)

#end

#end

 

 

Thanks,

Anuj






More information about the users mailing list