Currently in the Task Engine implementation there is a restriction that we cannot index lists. We can index an element of the list, but not the list itself (all elements).
Also the official response from SAG is that they will not support such a feature in the foreseeable future.
However we have a business scenario in which this is required or a viable workaround must be provided. (this scenario I think is quite common)
The scenario is the following:
The data model from the TaskData (a document called BusinessData) has under it a list of documents (let’s call them BusinessDocument).
This means that we have a 1-to-many relationship between the task and the documents. A task can have an arbitrary number of documents.
Some fields from the BusinessDocument have to be searchable. This means they have to be indexed. Let’s take for example the policyNumber.
Here the problem appears: we cannot index a list. Our workaround at that moment (2 years ago) was to do the following:
- add a field (policyNumbers) in the BusinessData object that contains a concatenated string of the policy numbers from all the BusinessDocument’s of the task. Every time a new document was added to the task, it’s policy number is appended to the policyNumbers string (using comma as a separator)
- we indexed the policyNumbers field as it is a plain string
- when searching for this we use the like operator
Please note that the policyNumbers is just an example. We did this for multiple such fields (around 10-15).
The search works as expected. However now another problem surfaced.
Let’s say that one policy number has around 50 characters.
If a tasks has 20 documents on it => the policyNumbers field would have over 1000 characters (20x50 + commas)
However at the DB level this is not possible, because (at least with MS SQL there is a 900 bytes restriction on indexed fields). See https://technet.microsoft.com/en-us/library/ms191241(v=sql.105).aspx . In this case we are in a dead end as no more documents can be added to the task.
There is a business need for us to be able to have more than 20 documents on a task.
Did you ever had this problem? If yes, what was your workaround for it?