Genesys CTI User Forum
Genesys CTI User Forum => Genesys-related Development => Topic started by: upk_singhm on December 29, 2014, 01:17:14 PM
-
Hi All,
I have a PSDK based agent application and I am trying to build search module for the eServices module to fetch records based on certain criterion:
1. Email To.
2. Email From.
3. Subject.
and a few other criterion, now I am able to get the search result from the Interactions using the Subject/Date/Custom Business attributes, BUT NOT Email To and Email From, has anyone done any work in this regard.
Any help is much appreciated to help identify how to fetch emails if search is based on Email To and Email From parameters.
Let me know if any details are required.
Regards,
-
You can use Apache Lucene for these purposes. All records are indexed by this software.
-
Hi Kubig,
Thanks for the quick response, can you throw some more light on this, I am using .NET for this application.
Regards,
-
UCS is using Apache Lucene SW for indexing and searching. So, you can use this API (there exists a DLL for Lucene on .net platform, IWS is using it). I am using following code for querying the UCS content:
[code]RequestSearch reqSearch = new RequestSearch();
reqSearch.IndexName = "interaction";
reqSearch.Query = _query;[/code]where the query can be something like that:
[code]StringBuilder sb = new StringBuilder();
sb.Append("MediaTypeId:email");
sb.AppendFormat(" AND StartDate:[{0}* TO {1}*]", FromDate, ToDate);
sb.AppendFormat(" AND EndDate:[{0}* TO {1}*]", FromDate, ToDate);
[/code]
etc.
-
Dear Kubig,
We tried using that and faced one challenge wherein we are not able to search for Business Attributes, let's say customer name or company name or ticket ID, if there's any. We are only able to search on the basis of system attributes like Email To, Email From, Subject, Date, Time. We also need to search on the basis of custom Business Attributes.
Do you have any ideas with that?
Regards,
Upkar S
-
The Business Attributes should be mapped to Str/Int Attribute columns, so you are able to filter out through these columns. In general, all information which are present within UCS database can be filtered by Lucene querying.
-
Hi Kubig,
So let me get this ironed out for me, so what you are saying is, I should find the mapping of these columns to one of the Str/Int/DateTime columns and simply use the names of these columns e.g. StringAttribute1 in my query?
Is my understanding correct?
Regards,
-
I suppose that you know Genesys on eServices/MCR layer and know how the mapping works. As I wrote, if can built own filter based on all information which are available within UCS database. Information which are not stored cannot be logical filtered by any application.
-
Yes, I understand the mapping for that matter. So can you let me know if my understanding which I stated in my earlier to be correct or not, I will change my queries accordingly.
Appreciate your help so far and quite a quick one at that.
Regards,
-
Yes, you was partly right. You will use the column names as a filter variable, but the columns are with suffix Str or Int, nothing else (you have to know, if you know mapping mechanism :-)).
-
Yeap to be precise they are like this:
StrAttribute1, StrAttribute2 .... StrAttribute10, IntAttribute1 .... IntAttribute5.
Appreciate your help and a much needed one at this moment.
I will keep you posted as to how we finally did it, once again thanks a lot for pitching in at this point in time.
Regards,
-
You are welcome. Let us know what is your final solution for this. I am not at my PC yet and cannot try it myself unfortunately.
-
Dear Kubig,
We tried running the search using the StrAttribute field which in my case is StrAttribute9 mapped to a column named "EmailAddress" and another one StrAttribute8 mapped to column name PFS_id, both have is-sortable option set to true in the CME.
I am not sure if there's something that we need to do to in the CME to make this run, but we are only able to search using the AllAttribute field for the custom data and for system fields like From, To, Subject it runs pretty smooth with no issues. But AllAttribute isn't the recommended approach we need to use the StrAttribute fields to search for custom attach data fields.
Any help in this regard is much appreciated.
Regards,
-
Did you restart UCS? What does start up logs say about those new columns?
-
Hi cavagnaro,
I did restart UCS and here's what it says about them:
PK_INTEGRITYREPORT on Id IR_Composite_1 on FirstId IR_Composite_1 on IssueId IR_Composite_2 on IssueId IR_Composite_2 on TenantId IR_Composite_2 on Status IR_Composite_3 on SecondId IR_Composite_3 on IssueId
Interaction:
StrAttribute9 nvarchar(256) nullable:true
05:31:41.949 Dbg 29999 [Ucs-Main] Attribute com.genesyslab.icc.api.contactserver.persistent.Chat#StrAttribute9 Mapped to parent class com.genesyslab.icc.api.contactserver.persistent.Interaction
05:31:41.949 Dbg 29999 [Ucs-Main] Attribute com.genesyslab.icc.api.contactserver.persistent.Interaction#StrAttribute9 Mapped to column StrAttribute9
05:31:41.986 Dbg 29999 [Ucs-Main] Attribute com.genesyslab.icc.api.contactserver.persistent.Callback#StrAttribute9 Mapped to parent class com.genesyslab.icc.api.contactserver.persistent.Interaction
05:31:42.158 Dbg 29999 [Ucs-Main] Attribute com.genesyslab.icc.api.contactserver.persistent.EmailIn#StrAttribute9 Mapped to parent class com.genesyslab.icc.api.contactserver.persistent.Interaction
05:31:42.180 Dbg 29999 [Ucs-Main] Attribute com.genesyslab.icc.api.contactserver.persistent.EmailOut#StrAttribute9 Mapped to parent class com.genesyslab.icc.api.contactserver.persistent.Interaction
I have only shown you selective logs from the UCS.
If you want I can also send you the logs for this but you will have to tell me how to send them to you.
Let me know if you need anything specific from the logs, if the ones above aren't enough.
Hope it helps.
-
Send export of database table for metadata (relation between columns and KVP) from UCS database.
This function works ok and without any errors, except errors within deployment or post-configuration.
-
Here it is,
I am not sure if it is readable enough. If not let me know I will try and provide in another format or better yet let me know how to send an attachment.
Id,TheName,DisplayName,TheType,TenantId,Active,ModifiedDate,Format,IsSortable,MappingColumnName
----------------------------------------------------------------------------------------------------------------------------------------------------------
00001a5GBQR4002F,Priority,Priority,0,1,1,2009-11-20 00:12:55.483,,0,NULL
00001a5GBQR4002G,ReasonCode,Reason Code,0,1,1,2009-11-20 00:12:55.483,,0,NULL
00001a5GBQR4002H,Category,Category,0,1,1,2009-11-20 00:12:55.483,,0,NULL
00001a5GBQR4002J,InteractionType,Interaction Type,0,1,1,2009-11-20 00:12:55.483,,0,NULL
00001a5GBQR4002K,MediaType,Media Type,0,1,1,2009-11-20 00:12:55.483,,0,NULL
00001a5GBQR4002M,Language,Language,0,1,1,2009-11-20 00:12:55.483,,0,NULL
00001a5GBQR4002N,StopProcessingReason,StopProcessing Reason,0,1,1,2009-11-20 00:12:55.500,,0,NULL
00001a5GBQR4002P,InteractionSubtype,Interaction Subtype,0,1,1,2009-11-20 00:12:55.500,,0,NULL
00001a5GBQR4002Q,ServiceType,Service Type,0,1,1,2009-11-20 00:12:55.500,,0,NULL
00001a5GBQR4002R,DispositionCode,Disposition Code,0,1,1,2009-11-20 00:12:55.500,,0,NULL
00043a67DR2M10UE,survey_answer_Overall,Survey Overall,0,1,1,2010-09-07 18:08:35.777,,1,StrAttribute3
00043a67DR2M10UU,survey_answer_ByAgent,Survey by Agent,0,1,1,2010-09-07 18:07:35.650,,1,StrAttribute2
00043a67DR2M10V8,survey_answer_Recommend,Survey Recommend,0,1,1,2010-08-31 01:21:09.047,,1,StrAttribute1
0006Da6R2VRS000W,FacebookCommentId,FacebookCommentId,0,1,1,2011-03-17 02:34:05.887,,1,StrAttribute4
0006Da6R2VRS000X,FacebookOutboundCommentId,FacebookOutboundCommentId,0,1,1,2011-03-17 02:34:05.887,,1,StrAttribute5
0006Da6R2VRS000Y,TwitterMsgId,TwitterMsgId,0,1,1,2011-03-17 02:34:05.887,,1,StrAttribute6
0006Da6R2VRS0010,FacebookPostId,FacebookPostId,0,1,1,2011-03-17 02:34:05.903,,1,StrAttribute7
000FWaAA2HWA000K,PFS_id,PFS ID,0,1,1,2015-01-05 11:48:19.607,,1,StrAttribute8
000FYaAAT1N1000K,EmailAddress,E-mail Address,0,1,1,2015-01-07 12:59:02.173,,1,StrAttribute9
000G0aAAVKNC000K,StrAttribute8,PFS ID Str,0,1,0,2015-01-08 20:32:07.327,,0,NULL
Thanks for the help.
-
Hi Cavagnaro/Kubig,
I am trying to search on StrAttribute9 which is mapped to EmailAddress
Id,[u][b]TheName[/b][/u],DisplayName,TheType,TenantId,Active,ModifiedDate,Format,[u][b]IsSortable,MappingColumnName[/b][/u]
----------------------------------------------------------------------------------------------------------------------------------------------------------
000FYaAAT1N1000K,[u][b]EmailAddress[/b][/u],E-mail Address,0,1,1,2015-01-07 12:59:02.173,[u][b],1,StrAttribute9[/b][/u]
Hope it helps.
Thanks
-
And if you add the parameter StrAttribute9 to the where condition, what is the result?
-
Hi Kubig,
Here's the query and the result:
SELECT *
FROM IxnAttributeMetaData
Where MappingColumnName = 'StrAttribute9'
Id,TheName,DisplayName,TheType,TenantId,Active,ModifiedDate,Format,IsSortable,MappingColumnName
----------------------------------------------------------------------------------------------------------------------------------------------------------
000FYaAAT1N1000K,EmailAddress,E-mail Address,0,1,1,2015-01-07 12:59:02.173,0,1,StrAttribute9
Let me know if it helps.
-
Hi Kubig,
I thought this might help as well, here's what it shows in the logs:
05:19:18.387 Trc 21126 [SvcSrvW-10] <844> 'OMInteractions.GetInteractions' (request id 844) handling duration : 9 ms.
05:19:21.356 Trc 21124 [ESP:4400] Request (queued for 0 ms): Id=2|Type=Request|AppName=UCS_Provider|AppType=|Service=Index|Method=Search.
05:19:21.356 Dbg 21291 [SvcSrvW-6] Thread 'SvcSrvW-6' registers to shutdown notification.
05:19:21.358 Trc 21124 [SvcSrvW-6] <2> Request (queued for 1 ms):
Id=2
Type=Request
AppName=UCS_Provider
AppType=
Service=Index
Method=Search
Parameters=
[
IndexName="interaction"
MaxResults=100
Query="StrAttribute9:"thompson@demosrv.genesyslab.com""
tkv.multibytes="false"
]
UserData=
[
].
05:19:21.361 Trc 21000 [SvcSrvW-6] <2 tcp://192.168.60.1:51233> Service 'Index' method 'Search' started.
05:19:21.393 Trc 21001 [SvcSrvW-6] <2> Service 'Index' method 'Search' ended, processing time (ms): 32.
05:19:21.394 Trc 21125 [SvcSrvW-6] <2> Response:
Id=2
Type=Response
AppName=ContactServer
AppType=CONTACT_SERVER
Service=Index
Method=Search
Parameters=
[
Documents=
[
]
FoundDocuments=0
ReturnedDocuments=0
]
UserData=
[
].
05:19:21.395 Trc 21126 [SvcSrvW-6] <2> 'Index.Search' (request id 2) handling duration : 40 ms.
-
Hi Kubig/Cavagnaro,
Did you find out anything about this?
Appreciate any help. Still struggling with this.
-
I will try to make a test in my lab env today and let you know with a result
-
Thanks Kubig,
Appreciate your help.
-
Did you follow this link http://docs.genesys.com/Documentation/ES/8.1.4/Admin/UCSSearchMake ? I am not at my PC yet, so still without my tests :)
-
Hi Kubig yes we did follow the instructions in that manual and if you look at some of the replies that I have mentioned above you will see that the fields from Interaction entity are mapped to the searchable columns and when I query the interaction table I do see the string attribute columns getting populated with the values as well so I hope and believe that I have configured, so I hope and believe that I have configured it as per that document unless this document in itself is missing something. And this brings me to think if there's something while installing the UCS App or DB server if we have to do something to enable this search functionality, which I i am pretty sure is configured already as otherwise i will not see the index attributes created and being enabled at the ucs level.
-
Using IWS does it works?
-
Hi Cavagnaro iWS only supports looking for contacts primarily and then for that contact it brings History from Interaction table. Correct me if I am wrong. So in essence I can look for contacts from the contact entity using iWS.
-
You are not right, IWS allows to search by any available interaction data within UCS database.
-
Hi Kubig,
Please correct my understanding, when I go into iWS and click the Contact button in the iWS toolbar, I get 2 panels one for the Contact Search and another for the Interaction History, now if I provide anything directly into the Interaction History panel, nothing comes up but when I search for a particular contact and then it brings along the history for that contact and then I can search within those Interactions for that contact.
Secondly: I have let's StrAttribute9 mapped to PFS_id, and under the options for the iWS application in the GA I provide the PFS_id to be a column to be listed in the Interaction History panel and then search for the records that have content for the PFS_id, it brings up those records, but when I do it for mapped column which is StrAttribute9 it doesn't bring up anything.
Hope it helps.
Let me know if you need anything else in this regard,
By the way were you able to test it out in your environment.
-
Hi Kubig,
Were you able to run this in your environment?
Let me know please.
-
Hi Kubig/Cavagnaro,
Any help is much appreciated in this regard.
-
Hi, sorry for delay. I did made a quick test and you are right and it does not work as expected. Unfortunately, I have not got time for deep investigation (read directly the Lucene and look at the available "columns") - so, try to test it yourself and let us know, what is the result.
-
Hi Kubig,
Thanks for the response, can you tell me at least if you tried it in iWS or with your custom PSDK app?
-
Tried within custom app. In IWS should be this available, so the test in IWS can lead to the find out the root-cause or format in what the query should be.
-
Hi Guys,
I recently received a response from Genesys stating in iWS search functionality was only made available in 8.5 version of iWS. So if any of you have recently upgraded to this version and tested it please let me know. I am in the process of upgrading mine. I will post my results if at all iWS is doing what I am looking for.
Thanks in advance.
-
With Workspace desktop 8.5 latest, you can search ucs for any interaction and search attributes are configurable.
It is not limited anymore to my interactions or interactions assigned with contact.
It is possible to search for instance, any interaction assigned to agent xy or any interaction sent from address yz.
The attribute doesnt need to be searchable. But when it is not indexed, performance of such search can be low and results are coming slowly. This depends from number of records in ucs and current load.
Be careful when you will try to get real time result from attributes which are not searchable. Searchable attribute should be indexed by ucs. Nad results based on these atributes should come back faster.
-
Hi Robik,
Thanks for your response, but let me enlighten you here that even with iWS it doesn't search using the StrAttribute columns instead searches for within the AllAttributes column and that is not a healthy way of doing it in a production environment since that column isn't indexed.
So I am now on the mercy of Genesys to let us know if at all customer attribute indexing works with Apache.Lucene or not.
Appreciate your response, I will keep you guys posted, I have a call with the Genesys team next week.
Regards,
Upkar