Question
Victaulic
US
Last activity: 4 Jan 2019 15:29 EST
Custom Search Parameters for Elastic Search - Pega 7.4 - defining params for search query
Hello, has anyone attempted to build query params (using pySearchWorkParams) in such a way, to use OR clause for search params?
For example, I have a property in two embedded pages, property "OrderNbr", in Primary.OrderInfo.OrderList(1).OrderNbr and Primary.OrderInfo.QuoteList(1).OrderNbr.OrderNbr.
This property can be present only in one of the pages in the same case. Not in both. So I need my search query to look at both places using an "OR" clause.
Now have enabled following settings:
- Added OrderNbr in custom search property, including it with the appropriate structure (see attached images).
- Ran re-index of my work data.
- In pySearchWorkParams activity, including steps to add params as shown below:
- .pyParams(<APPEND>).pyName = "OrderInfo.OrderList.OrderNbr"
- .pyParams(<LAST>).pyValue = AdvancedSearchCriteriaPage.OrderNbr
- .pyParams(<LAST>).pySection = "Work"
- Similarly, included another step to add params as shown below:
- .pyParams(<APPEND>).pyName = "OrderInfo.QuoteList.OrderNbr"
- .pyParams(<LAST>).pyValue = AdvancedSearchCriteriaPage.OrderNbr
- .pyParams(<LAST>).pySection = "Work"
Options tried:
Hello, has anyone attempted to build query params (using pySearchWorkParams) in such a way, to use OR clause for search params?
For example, I have a property in two embedded pages, property "OrderNbr", in Primary.OrderInfo.OrderList(1).OrderNbr and Primary.OrderInfo.QuoteList(1).OrderNbr.OrderNbr.
This property can be present only in one of the pages in the same case. Not in both. So I need my search query to look at both places using an "OR" clause.
Now have enabled following settings:
- Added OrderNbr in custom search property, including it with the appropriate structure (see attached images).
- Ran re-index of my work data.
- In pySearchWorkParams activity, including steps to add params as shown below:
- .pyParams(<APPEND>).pyName = "OrderInfo.OrderList.OrderNbr"
- .pyParams(<LAST>).pyValue = AdvancedSearchCriteriaPage.OrderNbr
- .pyParams(<LAST>).pySection = "Work"
- Similarly, included another step to add params as shown below:
- .pyParams(<APPEND>).pyName = "OrderInfo.QuoteList.OrderNbr"
- .pyParams(<LAST>).pyValue = AdvancedSearchCriteriaPage.OrderNbr
- .pyParams(<LAST>).pySection = "Work"
Options tried:
- Option 1: Add "OR" to second param like pyParams(<APPEND>).pyName = " OR OrderInfo.QuoteList.OrderNbr"
- Option 2: Added another step to add param as shown below:
- .pyParams(<APPEND>).pyName = "OR"
- .pyParams(<LAST>).pyValue = ""
- .pyParams(<LAST>).pySection = "Work"
For both options, Elastic search could not agree. I get below exceptions:
Option 1: Search request failed. Query: [*], Index [work*]
pyParams(9) |
|
||||||||||
pyParams(10) |
|
Option 2: java.lang.IllegalArgumentException: Invalid index type specified:
pyParams(9) |
|
||||||||||
pyParams(10) |
|
||||||||||
pyParams(11) |
|
***Edited by Moderator Marissa to update SR Details***