You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Philipp Bracher <ph...@obinary.com> on 2005/08/01 15:14:16 UTC
search: support of not like and case insensitive search
hi list,
i use jackrabbit in the cms project magnolia. Using the search facility
I found two problems I was not able to solve:
1) search seams to be case sensitive (xpath and sql syntax)
using LIKE 'test' and LIKE 'Test' is not returning the same result. Is
there a way to make the like function case insensitive?
2) xpath is not supporting predicate: [not(jcr:like(@title, '%test%'))]
Our user interface is providing the constraint: 'contains not'. Using
the predicate above i get an 'Unsupported function: not' exception.
//*[not (jcr:like(@title, '%Test%'))] order by @name ascending
ERROR
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/
dms].[jsp] ApplicationDispatcher.java(invoke:704) 01.08.2005 15:10:19
Servlet.service() for servlet jsp threw exception
javax.jcr.query.InvalidQueryException: Unsupported function: not
at
org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.createFunction(
XPathQueryBuilder.java:855)
at
org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.visit(XPathQuer
yBuilder.java:440)
Is this a bug? or do I mess up the syntax?
We use the following configuration:
<SearchIndex
class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
<param name="useCompoundFile" value="true" />
<param name="minMergeDocs" value="1000" />
<param name="maxMergeDocs" value="100000" />
<param name="mergeFactor" value="10" />
<param name="bufferSize" value="10" />
<FileSystem
class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
<param name="path" value="${wsp.home}/index" />
</FileSystem>
</SearchIndex>
I thank you in advance for your support
Philipp Bracher
Re: search: support of not like and case insensitive search
Posted by Philipp Bracher <ph...@obinary.com>.
;-) thanks
But reading the spec 6.6.5.2: ... In other words only support for '.'
is required. Support for property specific full text search is
optional.
Unless there is no solution with LIKE I will use the contains function
passing the property.
Philipp
Re: search: support of not like and case insensitive search
Posted by Fabrizio Giustina <fg...@gmail.com>.
Hi Philipp!
On 8/1/05, Philipp Bracher <ph...@obinary.com> wrote:
> hi list,
>
> i use jackrabbit in the cms project magnolia. Using the search facility
> I found two problems I was not able to solve:
>
> 1) search seams to be case sensitive (xpath and sql syntax)
> using LIKE 'test' and LIKE 'Test' is not returning the same result. Is
> there a way to make the like function case insensitive?
You should look at the magnolia source code for an example of
case-insensitive queries ;)
Look at
http://svn.magnolia.info/view/magnolia/trunk/src/main/info/magnolia/cms/taglibs/util/SimpleSearchTag.java?rev=1261&view=markup
it uses jcr:contains instead of like for queries
cheers
fabrizio
Re: search: support of not like and case insensitive search
Posted by Philipp Bracher <ph...@obinary.com>.
> 2) xpath is not supporting predicate: [not(jcr:like(@title, '%test%'))]
> Our user interface is providing the constraint: 'contains not'. Using
> the predicate above i get an 'Unsupported function: not' exception.
>
the contains function is applicable for the second problem too.
jcr:contains(@title, '-test') solves the problem.
Thanks
Philipp