使用 Solr 使用custom1、custom2、custom3、custom4 属性<cfsearch>
吗?文档说它们仅适用于 Verity MATCHES 操作员。如何在 Solr 中使用 customX <cfsearch>
?
谢谢
使用 Solr 使用custom1、custom2、custom3、custom4 属性<cfsearch>
吗?文档说它们仅适用于 Verity MATCHES 操作员。如何在 Solr 中使用 customX <cfsearch>
?
谢谢
是的,他们有。这是一个例子:
构建集合 字符串是列名。例如,“关键字”是查询“qIndex”中的有效列。
<cfindex collection = "#arguments.collectionName#"
action = "REFRESH"
type = "CUSTOM"
body = "Show_Name, Title"
key = "theKey"
custom1 = "Show_Description"
custom2 = "keywords"
custom3 = "Show_ID"
custom4 = "Asset_ID"
title = "Title"
query = "qIndex"
URLPath = "theURL" />
搜索集合
<!--- Populate the remaining attributes of the cfsearch tag --->
<cfif !structKeyExists(arguments, 'searchArgs')>
<cfset arguments.searchArgs = {
collection = arguments.collectionName
,criteria = "#arguments.term#"
,contextPassages = "1"
,contextBytes = "1024"
,suggestions = "always"
,status = "searchStatus" } />
</cfif>
<!--- Force the name of the result as its referenced only internally --->
<cfset arguments.searchArgs.name = 'qSearchResults' />
<!--- Try to search our collection using Solr --->
<cfsearch attributecollection="#arguments.searchArgs#" />