Question

1
Replies
762
Views
Close popover
Balaji Srinivasaraghavan (BalajiS6010)
Victaulic

Victaulic
US
BalajiS6010 Member since 2018 4 posts
Victaulic
Posted: December 24, 2018
Last activity: January 4, 2019
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 Support Case Exists
Moderation Team has archived post,
Close popover This thread is closed to future replies. Content and links will no longer be updated. If you have the same/similar Question, please write a new Question.