jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ard Schrijvers <a.schrijv...@onehippo.com>
Subject Re: full text search in jackrabbit
Date Wed, 25 Aug 2010 09:33:11 GMT
Hello Jason,

On Wed, Aug 25, 2010 at 11:24 AM, jason wang <jasonqiwang@hotmail.com> wrote:
>
> Hi,
>
>
>
> First of all, in order to use full-text search for files stored in JackRabbit, do I need
to set up indexing configuation manually? If so, how to set it up?

You can, but out-of-the-box there is a proper working one.

> Currently I just run the following codes: nothing returns (no exceptin either) even though
a file contains the text. Is the sql wrong?
>
> QueryManager manager = session.getWorkspace().getQueryManager();
> String sql = "SELECT * FROM [nt:file] AS file WHERE CONTAINS(file,'text should be found')";

Can you try:

CONTAINS(.,'text should be found')";

Regards Ard

> Query query = manager.createQuery(sql, Query.JCR_SQL2);
> QueryResult result = query.execute();
> NodeIterator itr = result.getNodes();
> hile (itr.hasNext()){
>      Node node = itr.nextNode();
>      System.out.println(node.getName());
>
> }
>
>
>
>
>
> Thanks a lot for your help.
>
> Jason
>
>
>

Mime
View raw message