Question
JPMorgan Chase
IN
Last activity: 11 Dec 2015 10:05 EST
how to implement Elastic Search
Hi Team,
We have made customization for pzSearch activity in PRPC 6.3, now our application is upgraded to Pega 7.1.7 and we are facing issue with that search activity. Below is the error which we are facing while tracing.
Failed to compile generated Java com.pegarules.generated.activity.ra_action_searchlpslucene_cf7408e28a85edafcdf7ab03130c0039: ----------
1. ERROR in com/pegarules/generated/activity/ra_action_searchlpslucene_cf7408e28a85edafcdf7ab03130c0039.java (at line 604)
com.pega.apache.lucene.analysis.Analyzer PEGA_ANALYZER_WITHOUT_STOPWORDS = new com.pega.apache.lucene.analysis.standard.StandardAnalyzer(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
An anonymous class cannot subclass the final class StandardAnalyzer
How to customize activity in Pega 7 to work?
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems
IN
Hi Naseema,
Before I give you any pointers, I have some questions
1) The error that you see comes when you are using Lucene version prior to 3.5 which was present in PRPC 6.2 SP2 or before. This should not be an issue with 6.3 or later (even in 7.1.7)
a) Do you have the right version of code?
b) Can you try a private checkout of your activity and see if the issue is still reproducible?
2) Did you get a chance to read the Elastic Search related post - https://community.pega.com/knowledgebase/release-note/action-required-admins-improved-search? If not, I suggest you read it first.
3) What use cases were you trying to solve by writing your own code for full text search (bypassing our pzSearchLucene activity)?
-Rajiv
JPMorgan Chase
IN
Hi Rajiv,
Thanks for reply.
Find below response to your questions:
1. Yes, we do have right version of code and we even tried by doing a private edit to already existing customized activity but the issue is reproducible.
2. Yes, we did re-indexing after upgrade.
3. Below is our use case description:
In our app we provided an option for user to search Cases and in back ground we are calling the ootb activity used by the Pega i.e pzSearchLucene.
What we customized for our search was, eliminated data and rule search, instead only work items have to be searched.
We provided two options for the user one is direct text search and other is we provided an option where user can select particular property and give the value for that property, and get a case from DB with these particular details.
Pegasystems
IN
1) This is strange because this was seen in versions prior to 6.3 upgraded to 6.3 or beyond, including Pega 7. I am assuming this was working fine for you in 6.3. Could you please confirm your 6.3 build number where this was working?
2) Elastic Search uses a completely different API and our existing search code has been modified to support that. Any customizations made would have to be re-done.
3) There are two list views that supported full text search. One was for developer portal - pySearchResults and the other for end user portals - pySearchResultsWork. Note that the first one did rule and data search whereas the second one did only work search and was later enhanced to work with data search for tags associated with cases. So I am not sure why you needed to customized it. Also, specific customization was provided using the activity DATA-FIND-SEARCH!PYSEARCHPARAMS where additional filters could be specified.
4) The search gadget on the top could be customized - https://docs-previous.pega.com/how-add-full-text-search-work-objects-and-text-attachments-composite-user-portal
JPMorgan Chase
IN
Thanks for your suggestion.,
As you stated in step that we have tow listviews one for developer and other for user portal, the same we are using in our app mentioned for user portal. The only difference we replaced the getcontent activity of the listview with pzsearchresults ootb activity used by pega with a different name to search work items in our app. Before upgrade it was working perfectly fine but after upgrade we are getting an exception in the java step of internal activity named pzsearchlucene shown below.
"Test compilation failed: ----------
1. ERROR in Rule_Obj_Activity_Data_Find_Search_SearchLPSLucene_Action_20151203T100944_928_GMT.java (at line 617)
com.pega.apache.lucene.analysis.Analyzer PEGA_ANALYZER_WITHOUT_STOPWORDS = new com.pega.apache.lucene.analysis.standard.StandardAnalyzer(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
An anonymous class cannot subclass the final class StandardAnalyzer"
And when we saw the upgraded acitivity of pega 7, this particular step is replaced with method call shown below
pega.search(myStepPage);
we too used the same but we are not fetching any result. can you let us know of which api of pega engine we can get the details and description of this particular method.
And whar are the input parameters to be set for this method.
Can we have a quick call for 5 minutes
Pegasystems
IN
As requested earlier, can you share your 6.3 environment details in terms what hotfixes are present and what build number you were using?
pega.search() is a private API for search and changes made to the implementation of this API supports out of the box search functionality (whatever the underlying technology maybe). Customized search functionality should be re-built to use the OOTB search API.
JPMorgan Chase
IN
Environment is 6.1 SP2.
And we are not able to check hotfixes on earlier version as it has been upgraded to 7.1.7
Pegasystems
IN
Hi Naseema,
That explains why you are getting compilation errors. The Lucene version in 6.1 SP2 was 3.0.0 and it was upgraded to 3.5.0 in 6.3. Since your initial post mentioned 6.3, I was confused on why you were still seeing errors. Lucene broke compatibility between 3.0.0 and 3.5.0 and all code was modified to work with the new APIs in 6.3.
That said, we no longer use Lucene 3.5.0 (even though the jar is still present in 7.1.7). We use Elastic Search as our search library and their API is completely different than Lucene even though its built on top of Lucene.
-Rajiv
JPMorgan Chase
IN
Since we have a use case of case search which is build and working in production, now again when we are going to upgrade to 7.1.7 these will not work.
So kindly suggest on how we can overcome these errors by providing same functionality
In our use case we are not only providing ability to do a global context search for not resolved cases but we are also providing a filter condition for the user to search accordingly on certain properties to be selected and given values.
If possible kindly provided related information on how to implement elastic search api its methods along with description.
--Naseema
Pegasystems
IN
Hi Naseema,
Please note that same APIs that were provided in prior releases will work seamlessly with Elastic Search. I don't have the full context / code to understand the customization made. So to give you a direct answer on how this can be changed would be difficult. To start with, you can see how the search control on the out of the box pyCaseManager portal works in 7.1.7 or beyond. Tracer will show you the activities and other rules involved and you can leverage the same code for your customization.
That said, I would highly discourage you from doing so. Instead I would suggest you reach out to our customer support or your account executive to engage Pega professionals to migrate this over to use our out of the box APIs.
-Rajiv