jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pkrishna <prabhakar.krishnasw...@ge.com>
Subject Re: Cannot get full-text searching to work
Date Sat, 13 Dec 2008 00:19:50 GMT

I sometimes search using multiple key words; I observe that results are
consistent and does not return results as expected.

I save a jcr:data node with the string --"This is Content one"
I do a search with the following query

//*[jcr:contains(.,'Content') and jcr:contains(.,'one')]

I expect 1 match but get 0;

The I overwrite jcr:data with -- "Test Content one"
I do a search with the following query

//*[jcr:contains(.,'Content') and jcr:contains(.,'one')]

I expect 2 but get 1

I again overwrite jcr:data with -- "Test others"
I expect 0 but still get 1


I then persist the following 
The jcr:data contains a String "This is Content one" and hence I expected
the result set to contain one node but I got zero results back.

Is my query correct?



Alexander Klimetschek wrote:
> 
> On Mon, Dec 8, 2008 at 11:13 PM, pkrishna <prabhakar.krishnaswami@ge.com>
> wrote:
>>  String query = "//*[jcr:contains(jcr:content, 'Test')]";
>>   String query = "//jcr:content[jcr:contains(., 'Test')]";
> 
> The first argument of jcr:contains() is either ".", which refers to
> the local node and by default means all properties of the current node
> (you can configure that, see the aggregation in [1]), or can be the
> name of a property, prefixed with an "@". So your query probably
> should look like:
> 
> //*[jcr:contains(., 'Test')]
> 
> This will give you back all jcr:content nodes. If you want to retrieve
> the parent nodes, you can change the aggregation to include the
> jcr:content subnode and its properties for your ecr:ecisContentItem
> nodes [1].
> 
> For the definition of the jcr:contains function, see section 6.6.5.2
> of the JCR 1.0 spec [2].
> 
> [1] http://wiki.apache.org/jackrabbit/IndexingConfiguration
> [2] http://jcp.org/en/jsr/detail?id=170
> 
> Regards,
> Alex
> 
> -- 
> Alexander Klimetschek
> alexander.klimetschek@day.com
> 
> 

-- 
View this message in context: http://www.nabble.com/Cannot-get-full-text-searching-to-work-tp20904596p20985882.html
Sent from the Jackrabbit - Dev mailing list archive at Nabble.com.


Mime
View raw message