Question

1
Replies
693
Views
BalajiS6010 Member since 2018 4 posts
Victaulic
Posted: 1 year ago
Last activity: 1 year 8 months ago
Closed

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:

  • 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)

Name

Value

pxObjClass

Data-Find-SearchParam

pyValue

7

pyName

OrderInfo.OrderList.OrderNbr

pySection

Work

pyParams(10)

Name

Value

pxObjClass

Data-Find-SearchParam

pyValue

7

pyName

OR OrderInfo.QuoteList.OrderNbr

pySection

Work

Option 2: java.lang.IllegalArgumentException: Invalid index type specified:

pyParams(9)

Name

Value

pxObjClass

Data-Find-SearchParam

pyValue

7

pyName

OrderInfo.OrderList.OrderNbr

pySection

Work

pyParams(10)

Name

Value

pxObjClass

Data-Find-SearchParam

pyValue

Work

pyName

OR

pyParams(11)

Name

Value

pxObjClass

Data-Find-SearchParam

pyValue

7

pyName

OrderInfo.QuoteList.OrderNbr

pySection

Work

***Edited by Moderator Marissa to update SR Details***

Low-Code App Development Data Integration Java and Activities Data Integration SR Exists
Moderation Team has archived post
Share this page LinkedIn