Strange issue with xpath repository query

Hi All,

I have added a field ‘title’ in my document and it stores string values. I am using ‘jcr:contains’ xpath query to fetch the results on this field. But it fails to retrieve results when provide following combinations:

  1. when my title is ‘UMA’
    and I try:
    //*[jcr:contains(@brxp:title,‘UMA’)] --> No result

  2. when my title is ‘UMA example’
    and I try:
    //[jcr:contains(@brxp:title,‘UMA’)] --> No result
    //
    [jcr:contains(@brxp:title, ‘UMA example’)] --> No result
    //*[jcr:contains(@brxp:title, ‘example’)] --> gets the result

  3. when my title is ‘example UMA’
    and I try:
    //[jcr:contains(@brxp:title,‘UMA’)] --> No result
    //
    [jcr:contains(@brxp:title,example UMA’)] --> No result
    //*[jcr:contains(@brxp:title, ‘example’)] --> gets the result

  4. when my title is ‘example UMA example’
    and I try:
    //[jcr:contains(@brxp:title,UMA’)] --> No result
    //
    [jcr:contains(@brxp:title,example UMA’)] --> No result
    //[jcr:contains(@brxp:title, ‘UMA example’)] --> No result
    //
    [jcr:contains(@brxp:title, ‘example’)] --> gets the result
    //*[jcr:contains(@brxp:title, ‘example UMA example’)] --> gets the result

Ideally, it should fetch result for all of the above query and it does so when i replace ‘UMA’ with any other word.

Can someone pls explain this strange behavior? Also in my case the title will end with ‘UMA’ word and how to get this working?

Thanks
Rahul

To get this working please try this query:
//*[jcr:like(@brxp:title,‘ %UMA ’)]

Hi Michiel,

Actually I want to use it for substring query and ‘UMA’ seems to be some special case(as per the results i see), hence wanted to understand that.

I guess "//*[jcr:like(@brxp:title,‘ %UMA ’)] " it would make it like ends with query.

Thanks
Rahul

uma is part of Portuguese stopword analyzer and is most probably not indexed. If you don’t use PT language you can exclude it and re-index your repository

see:

Thank you :slight_smile:

Hi All,

I have made changes as suggested in[1]. My project uses separate deploy for author and render and hence I have added ‘StandardHippoAnalyzer_pt_BR.properties’ to ‘cms’ and ‘repository’ module.

I am executing xpath query from my REST service to fetch the result. Things seems to work fine on my local but when I deploy on server, it is unable to fetch result for ‘UMA’. I suspect issue with indexing.Can you please tell me if I am missing anything else? I also tried by adding ‘StandardHippoAnalyzer_pt_BR.properties’ to site module as well.

I am on version 12.4.0.

[1] https://documentation.bloomreach.com/library/administration/lucene-analyzer.html
Thanks
Rahul

you need to re-index your repository to see the changes