1st prototype with Insert/ Fields/ More Fields → Variables/ User Field created via macro. The Pages in Index aren’t clickable like links, but I hope I understood well you need something like this. It is without sorting of Authors and without update of Index.
Open new document and run macro ownIndex.
global gAuthors()
global const gName="author" 'name for user TextFields
Sub ownIndex
on local error goto bug
rem initialization of authors
gAuthors=array("Jožin Flaška", "Řehoř Násos", "Anča Frťanová", "Péťa Motačka")
dim oDoc as object, oVCur as object
oDoc=ThisComponent
oDoc.Text.String=""
oVCur=oDoc.CurrentController.ViewCursor
rem put text to document and authors
oVCur.String="1st outstanding man is "
insertUserField(0, oDoc) 'write author
oVCur.String=String(25, chr(13)) & "he's not bad guy, only sad, says his best friend in bottle "
insertUserField(1, oDoc)
oVCur.String=String(25, chr(13)) & "Hi guys, have you some drink for us today? Ask "
insertUserField(2, oDoc)
oVCur.String=" and "
insertUserField(3, oDoc)
oVCur.String=String(25, chr(13)) & "And boys looked like some stupid alcoholics and it is end of this famous story "
insertUserField(0, oDoc)
oVCur.String=String(1, chr(13))
insertUserField(2, oDoc)
rem create Index
GlobalScope.BasicLibraries.LoadLibrary("ScriptForge")
oDoc.lockControllers
dim oMasters as object, sElem$, sName$, oField as object, i%, o as object, sIndex$, pages(), iCount%
sIndex=String(3, chr(13)) & "---------Index with numbers of pages---------" & chr(13)
oMasters=oDoc.getTextFieldMasters()
for each sElem in oMasters.ElementNames
sName="com.sun.star.text.fieldmaster.User." & gName
if inStr(sElem, sName)>0 then 'there is author's TextField
oField=oMasters.getByName(sElem) 'TextField with current author
sIndex=sIndex & oField.Content & ": "
iCount=ubound(oField.DependentTextFields)
redim pages(iCount)
for i=0 to iCount 'all fields of this author
o=oField.DependentTextFields(i)
oVCur.goToRange(o.Anchor.Start, false) 'move visible cursor to the start of TextField to get the Number of Page
pages(i)=oVCur.Page 'page with current TextField
next i
sIndex=sIndex & join(SF_Array.sort(pages), ", ") & chr(13)
end if
next
rem write Index
oVCur.goToEnd(false)
oVCur.String=sIndex
oVCur.goToEnd(false)
bug:
if oDoc.hasControllersLocked then oDoc.unlockControllers()
End Sub
Sub insertUserField(idAuthor%, oDoc as object) 'modified: A. Pitonyak macro book - chapter 14.10.2 listening 388
dim sLead$, sName$, sTotName$, oMasters as object, oVCur as object, oText as object, oUField as object, oMasterField as object
oText=oDoc.Text
oVCur=oDoc.CurrentController.ViewCursor
sName=gName & idAuthor
sLead="com.sun.star.text.FieldMaster.User"
sTotName=sLead & "." & sName 'com.sun.star.text.FieldMaster.User.author1
oMasters=oDoc.getTextFieldMasters()
oUField=oDoc.createInstance("com.sun.star.text.TextField.User")
if oMasters.hasByName(sTotName) then
oMasterField=oMasters.getByName(sTotName)
else
oMasterField=oDoc.createInstance(sLead)
oMasterField.Name=sName
oMasterField.Content=gAuthors(idAuthor)
end if
oUField.attachTextFieldMaster(oMasterField)
oText.insertTextContent(oVCur.getEnd(), oUField, False)
oVCur.goToEnd(false)
End Sub