Hi. I just learned about the DocumentSearchServiceImpl from https://elearning.mgm-tp.com/learner_module/show/34223?lesson_id=131358§ion_id=447313
I have several questions on this:
- I wonder why DocumentSearchServiceImpl is used.
– It obviously simplifies the search for documents compared to the seen complexity in DocumentQueryService
– However, it’s from an internal package (com.mgmtp.a12.kernel.md.document.internal.service) and is this intended to be used by projects?
– Is there another “simpler” solution possible with a different public API?
- I wonder what the “repetition” Array means.
– There is no Javadoc on this, so I can only guess.
– What is the default value?
– How is it expected to be filled?
– Is there an easier solution to the repetition array?
Thanks.
Hi @stefan-grey-canyon ,
I have changed the tag to Kernel because the API you are mentioning is a kernel API. This is a search service that is meant to be used for searching a fields in the document. It is internal because it is hidden behind the Public API interface and I believe it should be used via DocumentServiceFactory.
DocumentQueryService is used to search documents by the field values and this is Data Services API. This operates the set of multiple documents.
Just a note - I stumbled upon that, as well. IMO any experienced Java developer would guess that IDocumentSearchService searches for and returns IDocuments.
@stefan-grey-canyon The repetition array is meant to add indices to document element paths so as to uniquely identify element instances in a document, as I understood it. E.g. if you have a document model such as (pseudocode)
{
Group: {
name: "root",
repeatability: 1,
elements: [
{
Group: {
name: "repeatableGroup",
repeatability: 10,
elements: [
{
Field: {
name: "Field"
}
}
]
}
}
]
}
}
and a document
{
root:
{
repeatableGroup: [
{Field: "abc"},
{Field: "xyz"}
]
}
}
querying for the value at document path root/repeatableGroup/Field would give you “abc” with repetitions array [1, 1, 1] and “xyz” with repetitions array [1, 2, 1] (non-repeatable groups/fields always have 1 and indices are one-based)
I agree that this is a bit confusing and could benefit from improved documentation.