Advertisement
Guest User

Untitled

a guest
Jul 10th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <cffunction name="init" access="public" output="no" returntype="boolean">
  2. <cfcollection action="list" name="collections" engine="solr">
  3.  
  4. <!--- collection check --->
  5. <cfif not listFindNoCase(valueList(collections.name), "artikel")>
  6.  
  7. <cfcollection action="create" collection="artikel" engine="solr" path="#expandpath('./solr')#" language="german">
  8. </cfif>
  9. <cfif not listFindNoCase(valueList(collections.name), "kunden")>
  10.  
  11. <cfcollection action="create" collection="kunden" engine="solr" path="#expandpath('./solr')#" language="german">
  12. </cfif>
  13. <cfif not listFindNoCase(valueList(collections.name), "reseller")>
  14.  
  15. <cfcollection action="create" collection="reseller" engine="solr" path="#expandpath('./solr')#" language="german">
  16. </cfif>
  17.  
  18. <cfif not listFindNoCase(valueList(collections.name), "premiumreseller")>
  19.  
  20. <cfcollection action="create" collection="premiumreseller" engine="solr" path="#expandpath('./solr')#" language="german">
  21. </cfif>
  22.  
  23.  
  24. <cfset artikelliste = EntityLoad("artikel")>
  25. <cfset liste = EntityToQuery(artikelliste)>
  26. <cfif liste.recordcount>
  27. <cfindex collection="artikel" action="update" body="name" title="artikelnr" key="artikelid" query="liste" category="artikel">
  28. </cfif>
  29.  
  30. <cfset resellerliste = EntityLoad("reseller")>
  31. <cfset liste = EntityToQuery(resellerliste)>
  32. <cfif liste.recordcount>
  33. <cfindex collection="reseller" action="update" body="firma,vorname,nachname" title="firma,vorname,nachname" key="resellerid" query="liste" category="reseller">
  34. </cfif>
  35.  
  36. <cfset kundenliste = EntityLoad("kunden")>
  37. <cfset liste = EntityToQuery(kundenliste)>
  38. <cfif liste.recordcount>
  39. <cfindex collection="kunden" action="update" body="firma,vorname,nachname" title="firma,vorname,nachname" key="kundenid" query="liste" category="kunde">
  40. </cfif>
  41.  
  42. <cfset premium = EntityLoad("premiumreseller")>
  43. <cfset liste = EntityToQuery(premium)>
  44. <cfif liste.recordcount>
  45. <cfindex collection="premiumreseller" action="update" body="firma,vorname,nachname" title="firma,vorname,nachname" key="premiumresellerID" query="liste" category="premiumreseller">
  46. </cfif>
  47. <cfreturn true>
  48. </cffunction>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement