我在我的 RTE 中使用后缀 _html 来实现 solr 的索引功能。但是,当我显示我的搜索结果时,我需要 html 标签而不是纯文本。有解决办法吗?
编辑:我使用地图 ,matches = [:]
来存储我的 solr 查询的结果。我需要content_html
从每个文档中获取结果并显示它们。这是我到目前为止的进展:
时髦的:
def contents = [:]
def index = 0
// solr search results are stored in matches.faqs
for (item in matches.faqs) {
// with a solr result document
def aResult = executedQuery.response.documents[index]
// look up the item
def myContentItem = siteItemService.getSiteItem(aResult.localId)
// get the markup you want
contents.put('contentHtml', myContentItem.queryValue("content_html"))
index++
}