Is it possible to have url formatted fields with label from another field?
something equivalent to html: < a href="fieldUrl">fieldLabel < /a >
Is it possible to have url formatted fields with label from another field?
something equivalent to html: < a href="fieldUrl">fieldLabel < /a >
i guess you could use a scripted field to generate something like this.
return '<a href="' + doc['fieldUrl'].value + '">' + doc['fieldLabel'].value + '</a>';
hope this gives you some ideas.
brilliant, thank you
however, this does not work:
return '< a href="' + doc['dataUri'].value + ' " > ' + doc['dataTitle'].value + '< /a >';
while this one does:
return '< a href="' + params['_source']['dataUri'] + ' ">' + params['_source']['dataTitle'] + '< /a >';
the returned string is something similar to:
< a href="www.google.com">link to google< / a>
The problem is how to use the html code to display it as clickable link, in a table visualization for instance.
I have tried to use the Url formatter playing with "Url Template" and "Label Template" settings with no positive outcome.
i don't think this will be possible.
you could use url formatter but you won't get to exactly what you are looking for:
dataUri
field in managenentmy link
) if you don't want the url to be visible in the table.but, you can't use another field to set the label ...
even if this would be scripted field which would produce something like my label:my url
there is no way to split this in the url template/label template as {{value}} at those fields represents the whole field value.
might be worth opening a feature request on github.
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
© 2020. All Rights Reserved - Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.