Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <cffunction name="init" access="public" output="no" returntype="boolean">
- <cfcollection action="list" name="collections" engine="solr">
- <!--- collection check --->
- <cfif not listFindNoCase(valueList(collections.name), "artikel")>
- <cfcollection action="create" collection="artikel" engine="solr" path="#expandpath('./solr')#" language="german">
- </cfif>
- <cfif not listFindNoCase(valueList(collections.name), "kunden")>
- <cfcollection action="create" collection="kunden" engine="solr" path="#expandpath('./solr')#" language="german">
- </cfif>
- <cfif not listFindNoCase(valueList(collections.name), "reseller")>
- <cfcollection action="create" collection="reseller" engine="solr" path="#expandpath('./solr')#" language="german">
- </cfif>
- <cfif not listFindNoCase(valueList(collections.name), "premiumreseller")>
- <cfcollection action="create" collection="premiumreseller" engine="solr" path="#expandpath('./solr')#" language="german">
- </cfif>
- <cfset artikelliste = EntityLoad("artikel")>
- <cfset liste = EntityToQuery(artikelliste)>
- <cfif liste.recordcount>
- <cfindex collection="artikel" action="update" body="name" title="artikelnr" key="artikelid" query="liste" category="artikel">
- </cfif>
- <cfset resellerliste = EntityLoad("reseller")>
- <cfset liste = EntityToQuery(resellerliste)>
- <cfif liste.recordcount>
- <cfindex collection="reseller" action="update" body="firma,vorname,nachname" title="firma,vorname,nachname" key="resellerid" query="liste" category="reseller">
- </cfif>
- <cfset kundenliste = EntityLoad("kunden")>
- <cfset liste = EntityToQuery(kundenliste)>
- <cfif liste.recordcount>
- <cfindex collection="kunden" action="update" body="firma,vorname,nachname" title="firma,vorname,nachname" key="kundenid" query="liste" category="kunde">
- </cfif>
- <cfset premium = EntityLoad("premiumreseller")>
- <cfset liste = EntityToQuery(premium)>
- <cfif liste.recordcount>
- <cfindex collection="premiumreseller" action="update" body="firma,vorname,nachname" title="firma,vorname,nachname" key="premiumresellerID" query="liste" category="premiumreseller">
- </cfif>
- <cfreturn true>
- </cffunction>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement