4 Replies Latest reply on Feb 21, 2009 8:47 AM by plarts

    Multiple CFINDEX

    plarts Level 1
      Is it possible to run multiple CFINDEX (on DB query on different datasource) in a same cfm file ?
      When doing that, I have strange result.
      When searching for a keyword, it is found from some of the cfindex (on query) and not from others.

      Example , searching for "piano"
      If I use a single CFINDEX , then it is retrieved.
      If I use several CFINDEX, depending which one, it is not found anymore.

      Thanks for any help

      Here is the code used :

      <CFQUERY NAME="article" datasource="#Article_datasource#">
      SELECT A_contenu,dt_titre,dt_id from dossier_tech
      inner join articles on articles.a_id=dossier_tech.dt_a_id
      </CFQUERY>
      <cfindex action="update"
      collection="arpille_site"
      key="dt_id"
      type="CUSTOM"
      title="s_article"
      query="article"
      body="a_contenu,dt_titre">



      <CFQUERY NAME="activite" datasource="#asv_datasource#">
      SELECT societe,societe_activite,act_id from activite
      </CFQUERY>
      <cfindex action="update"
      collection="arpille_site"
      key="act_id"
      type="CUSTOM"
      title="s_activite"
      query="activite"
      body="societe,societe_activite">



      <CFQUERY NAME="service" datasource="#asv_datasource#">
      SELECT societe,societe_service,ser_id from service
      </CFQUERY>
      <cfindex action="update"
      collection="arpille_site"
      key="ser_id"
      type="CUSTOM"
      title="s_service"
      query="service"
      body="societe,societe_service">


      <CFQUERY NAME="forum" datasource="#forum_datasource#">
      SELECT quest_topic_id,quest_id,quest_text,quest_sujet,ans_text from answers
      inner join questions on answers.ans_quest_id=questions.quest_id
      </CFQUERY>
      <cfindex action="update"
      collection="arpille_site"
      key="quest_id"
      type="CUSTOM"
      title="s_forum"
      query="forum"
      body="quest_text,quest_sujet,ans_text">


      <CFQUERY NAME="agenda" datasource="#Article_datasource#">
      SELECT ag_titre,ag_des,ag_id from agenda
      </CFQUERY>
      <cfindex action="update"
      collection="arpille_site"
      key="ag_id"
      type="CUSTOM"
      title="s_agenda"
      query="agenda"
      body="ag_titre,ag_des">

      <CFQUERY NAME="annonce" datasource="#Article_datasource#">
      SELECT an_titre,an_des,an_id from annonces
      </CFQUERY>
      <cfindex action="update"
      collection="arpille_site"
      key="an_id"
      type="CUSTOM"
      title="s_annonce"
      query="annonce"
      body="an_titre,an_des">
        • 1. Re: Multiple CFINDEX
          plarts Level 1
          I am just adding additionnal informations for the problem.

          Using these mutiple CFINDEXING, make that for a same table (ans same datasoource)
          some text are retrived , and some others NO !
          I do not understand why ?

          Is there any body from Adobe, or ex Macromedia who could help on this question ?

          Thanks to all.
          Pierre.
          • 2. Re: Multiple CFINDEX
            shloime11 Level 1
            Did you ever figure this out? I'm having very similar problems.

            Does it work fine if you do them in seperate CFMs?
            • 3. Multiple CFINDEX
              plarts Level 1
              I am still trying to understand that problem with multiple cfindex,

              I think I unsderstand something :
              If I first do a cfindex on a query 1 : it keeps the record keys
              when running a second cfindex, if the key found have the same value (from another table)
              it takes the last , and the first found in first cfindex is lost.

              So how to use the "key" in cfindex to work with multiple cfindex with different cfquery ?

              This is what I am looking for now.

              Thanks for any help.
              Adobe people do not care of this Forum ? why did they buy ColdFusion ?
              • 4. Re: Multiple CFINDEX
                plarts Level 1
                I finally found the solution,

                the keys found in all CFindex must be different.
                So if I use an primary key for the key, which is a numeric,
                there is a chance to find the same number with different cfindex,

                So the key of cfindex should refer to table column which have different data (unic).
                It better to refer to a field containing text than a numeric.
                Text have more chance to be different.