custom1、custom2、custom3、custom4 in w/ solrを使用する方法は?
-
23-10-2019 - |
質問
custom1、custom2、custom3、custom4属性を行います <cfsearch>
solrで作業しますか?ドキュメントでは、それらは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#" />
所属していません StackOverflow