Combining Verity with Query of Queries

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Combining Verity with Query of Queries

    Verity is capable of very powerful text searches and indexing, but it only
    returns Key, title, and decription. I'm working on an e-commerce site and for
    a project I'm working on, I would like to take the query returned by cfsearch
    and join it with a query of the rest of the information in the indexed
    database. Doing so should allow me to search through product decription fields
    in Verity, then use the list of keys to quickly gather the rest of the
    information. According to documentation on Query of Queries, Joining should be
    supported, yet I keep getting errors like 'Expected conditional statement'
    during the statements in my Where statements. Here's what I've been doing so
    far:

    <html><head><title>Result</title></head>
    <body>
    <H1> Result </h1>
    <cfsearch collection="test2" name="myq" criteria="#Form.q#" maxrows="100"
    status="info" type="internet">

    <cfquery name="Alldata" datasource="fooz">
    Select *
    From bar
    </cfquery>

    <cfquery name="Cross" dbtype="query">
    select *
    from myq INNER JOIN Alldata
    ON myq.Key = Alldata.K
    </cfquery>

    <cfoutput>
    Your search returned #Cross.RecordCount# entries.<p>
    </cfoutput>
    <cfoutput query="Cross">
    <p><table>
    <tr><td>Score: </td><td>Score</td></tr>
    <tr><td>Key: </td><td>#Key#</td></tr>
    <tr><td>Textfield:</td><td>#Info#</td></tr>
    <tr><td>Summary: </td><td>Summary</td></tr>
    </table></p>
    </cfoutput>
    </body></html>

    I've tried some other queries like
    From myq, Alldata
    Where myq.Key=Alldata.K

    and even
    From Alldata
    WHERE Alldata.k in (#ValueList(myq.Key)#)

    but neither work properly. Any ideas?

    Kletian Guest

  2. Similar Questions and Discussions

    1. Query of Queries - Combining Two Datasources
      Problem: Query needs to combine fields from one datasource with those of another, matching on a common ID. Example: <CFQUERY...
    2. Query of Queries Combining Results
      I have a question related to query of queries and unions/joins. Below are my two queries and the output from them. What I need to do is join the...
    3. Query of Queries on query New type query
      In CF5 we have a page that creates a query, using queryNew and querySetCell and the like, we then used dbtype="query" and gave it's name so we could...
    4. combining verity collection searches
      I was wondering about combining the results of two different collections and the best way to approach this. If I have 1 table which consists of 3...
    5. Verity - Combining Explicit Search Operators
      Hi, I am trying to combine search operators but finding no examples or help in the CF documentation. Can anyone help with the proper CFSEARCH...
  3. #2

    Default Re: Combining Verity with Query of Queries

    I've found that joins can be very particular about 'Select *'. In most cases
    you have to specify all of the variables you want. select myq.key as key,
    myq.score as score, ..... etc. From myq, Alldata Where myq.Key=Alldata.K

    Mancho00 Guest

  4. #3

    Default Re: Combining Verity with Query of Queries

    Yay, it works now! Thank you.
    Kletian Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139