Go to the first, previous, next, last section, table of contents.
The general structure of the file is as follows:
# # Link fulcrum with SQL database # # # Fulcrum field numbering start from serial and up (suggested 230) # serial = <number> # # How many fulcrum deletions/update can be done in one # request (suggested 1000) # chunksize = <number> # # SQL base name # <sql database> # # General parameters for base # params # # Name of the fulcrum table # table = <fulcrum tablename> end # # SQL tables mapping # tables <sql tablename> params # # Only records matching this where # clause will be inserted # where = <sql where clause> # # Merge part of a linked row into # each entry. Link must be defined in # relations.spec. # merge table = <sql tablename> fields = <sql fieldname,sql fieldname,...> end end fields <sql fieldname> field = <fulcrum fieldname> end ... end end ... query params # # Name of the fulcrum table # table = <fulcrum tablename> # # Reduce factor for or'ed terms (suggested 100) # divide_or = <number> # # When a row is found, retrieve only these fields # extract = <fulcrum fieldname>,<fulcrum fieldname>,... # # Relevance method # relevance = relevance(<fulcrum relevance>) as rel, <fulcrum orderby fields> # # When querying the order by clause is order # order = <fulcrum orderby> # # If a constraint is matched, apply this weight # (suggested 1000) # constraint_weight = <number> # # Map table names to template names # templates <sql table,sql table,...> = <template basename> ... end end groups <group number> where = <fulcrum where clause> weight = <number> constraint = <constraint re> fields = <fulcrum fields> end ... end end end
Here is a complete example:
# # Link fulcrum with SQL database # # # Fulcrum field numbering start from serial and up # serial = 230 # # How many deletions/update can be done in one request # chunksize = 1000 # # Mysql base name # interbat # # General parameters for base # params # # Name of the fulcrum table # table = intersmall end # # Mysql tables mapping # tables societe params # # Only records matching this where # clause will be inserted # where = find_in_set('interbat', typesociete) end fields typesociete field = so_typesociete end nomaffiche field = so_nomaffiche end raisonsociale field = so_raisonsociale end raisonsocialecomplementaire field = so_raisonsocialec end sigle field = so_sigle end motscles field = so_motscles end descriptif field = so_descriptif end descriptiflong field = so_descriptiflong end activite field = so_activite end url field = so_url end mail field = so_mail end adresse field = so_adresse end codepostal field = so_codepostal end ville field = so_ville end pays field = so_pays end tel field = so_tel end end end start params # # Only records matching this where # clause will be inserted # where = disabled = 'no' end fields descriptif field = st_descriptif end url field = st_url end debut field = st_debut end fin field = st_fin end end end personne params # # Only records matching this where # clause will be inserted # where = publiable = 'yes' # # Merge part of a linked row into # each entry. Link must be defined in # relations.spec # merge table = societe fields = typesociete end end fields nom field = pe_nom end url field = pe_url end mail field = pe_mail end fonction field = pe_fonction end adresse field = pe_adresse end codepostal field = pe_codepostal end ville field = pe_ville end pays field = pe_pays end tel field = pe_tel end end end produitsnouveaux params # # Only records matching this where # clause will be inserted # # where = end fields texte field = pn_texte end nom field = pn_nom end url field = pn_url end debut field = pn_debut end fin field = pn_fin end end end marque params # # Only records matching this where # clause will be inserted # # where = # # Merge part of a linked row into # each entry. Link must be defined in # relations.spec # merge table = societe fields = typesociete end end fields marque field = ma_marque end descriptif field = ma_descriptif end end end end query params # # Name of the fulcrum table # table = interall # # Reduce factor for or'ed terms # #divide_or = 100 # # When a row is found, retrieve only these fields # extract = r_societe,r_marque # # Relevance method # relevance = relevance('2:2') as rel,ma_marque # # When querying the order by clause is order # order = rel desc,ma_marque # # If a constraint is matched, apply this weight # constraint_weight = 1000 # # Map table names to template names # templates societe,start = start marque,societe = marquebatibase personne,societe = personnebatibase produitsnouveaux,societe = produitsnouveaux societe = societebatibase end end groups 1 where = so_typesociete contains 'interbat' weight 0 weight = 900 constraint = so_.* fields = so_raisonsociale,so_sigle,so_motscles end 2 where = so_typesociete contains 'interbat' weight 0 weight = 900 constraint = ma_.* fields = ma_marque,ma_descriptif end 3 where = (pn_debut < now() and pn_fin > now()) weight = 800 constraint = pn_.* fields = pn_nom,pn_texte,pn_url end 4 # where = (st_debut < now() and st_fin > now()) weight = 700 constraint = st_.* fields = st_url,st_descriptif end 5 weight = 700 # st_url,ho,pa,tx constraint = (ho|pa|tx|e_text) fields = e_text end 6 where = so_typesociete contains 'batibase' weight 0 weight = 130 constraint = so_.* fields = so_raisonsociale,so_sigle,so_motscles end 7 where = so_typesociete contains 'batibase' weight 0 weight = 130 constraint = ma_.* fields = ma_marque,ma_descriptif end 8 weight = 50 constraint = so_.* fields = so_url,so_mail,so_adresse,so_codepostal end 9 weight = 50 constraint = pe_.* fields = pe_nom,pe_url,pe_mail,pe_fonction,pe_adresse end end end end
Go to the first, previous, next, last section, table of contents.