# Strange issue with xpath repository query

**URL:** <https://community.bloomreach.com/t/strange-issue-with-xpath-repository-query/1274>\
**Category:** Experience Manager (PaaS/OnPrem)\
**Created:** [July 19, 2019, 7:39am UTC](https://community.bloomreach.com/t/strange-issue-with-xpath-repository-query/1274 "2019-07-19T07:39:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rahul\_Raj](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/rahul_raj/32/329_2.png) [@Rahul\_Raj](https://community.bloomreach.com/u/Rahul_Raj)\
**Post date:** [July 19, 2019, 7:39am UTC](https://community.bloomreach.com/t/strange-issue-with-xpath-repository-query/1274/1 "2019-07-19T07:39:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![michiel\_eggermont](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/michiel_eggermont/32/40_2.png) [@michiel\_eggermont](https://community.bloomreach.com/u/michiel_eggermont)\
**Post date:** [July 19, 2019, 9:25am UTC](https://community.bloomreach.com/t/strange-issue-with-xpath-repository-query/1274/2 "2019-07-19T09:25:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Rahul\_Raj](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/rahul_raj/32/329_2.png) [@Rahul\_Raj](https://community.bloomreach.com/u/Rahul_Raj)\
**Post date:** [July 19, 2019, 9:47am UTC](https://community.bloomreach.com/t/strange-issue-with-xpath-repository-query/1274/3 "2019-07-19T09:47:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![machak](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/machak/32/1298_2.png) [@machak](https://community.bloomreach.com/u/machak)\
**Post date:** [July 19, 2019, 10:07am UTC](https://community.bloomreach.com/t/strange-issue-with-xpath-repository-query/1274/4 "2019-07-19T10:07:45Z")

</div>

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:

> **[Configure the Lucene Analyzer - BloomReach Experience - Open Source CMS](https://documentation.bloomreach.com/library/administration/lucene-analyzer.html)**
>
> Open Source Enterprise Content Management

---

<div class="post-metadata">

**Author:** ![Rahul\_Raj](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/rahul_raj/32/329_2.png) [@Rahul\_Raj](https://community.bloomreach.com/u/Rahul_Raj)\
**Post date:** [July 19, 2019, 12:20pm UTC](https://community.bloomreach.com/t/strange-issue-with-xpath-repository-query/1274/5 "2019-07-19T12:20:46Z")

</div>

> [@machak](#):
>
> 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

Thank you 🙂

---

<div class="post-metadata">

**Author:** ![Rahul\_Raj](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/rahul_raj/32/329_2.png) [@Rahul\_Raj](https://community.bloomreach.com/u/Rahul_Raj)\
**Post date:** [August 7, 2019, 4:16pm UTC](https://community.bloomreach.com/t/strange-issue-with-xpath-repository-query/1274/6 "2019-08-07T16:16:49Z")

</div>

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](https://documentation.bloomreach.com/library/administration/lucene-analyzer.html)  
Thanks  
Rahul

---

<div class="post-metadata">

**Author:** ![machak](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/machak/32/1298_2.png) [@machak](https://community.bloomreach.com/u/machak)\
**Post date:** [August 8, 2019, 8:41am UTC](https://community.bloomreach.com/t/strange-issue-with-xpath-repository-query/1274/7 "2019-08-08T08:41:59Z")

</div>

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