Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sorting by score in searchService.cfc not working #13

Open
JonnyHayes opened this issue Apr 15, 2014 · 4 comments
Open

Sorting by score in searchService.cfc not working #13

JonnyHayes opened this issue Apr 15, 2014 · 4 comments

Comments

@JonnyHayes
Copy link

Hi - Think I've uncovered a bug - not sure if it's related to CF10/MSSQL or and oddity with QoQ in CF10, or something else (or even if it is indeed a bug):

Try this at ln 403: cfquery name="rsScore" dbtype="query"
select contentID,score ,context from rsDbSearch
where contentID=
/cfquery
< cfdump var="#rsScore#" >

and add this:

SCORE:<cfdump var="#rs#"><cfabort>
<cfreturn rs />

The rsScore dump dumps the correct score (0.3227 etc) , rs dumps 0.

Basically - it returns the '0' value set in the rs query at line 300 and NOT the correct score.SO... upshot is that it always returns '0' instead of the correct querysetcell at ln 408.

For my test search I used a quoted phrase - e.g. "My search term" .
Still trying to fix it from my end - if I come up with a solution before you do I'll share it here....
cheers
jon

@mattlevine
Copy link
Member

Could you dump this right after this line to see if the value stuck

https://github.com/blueriver/MuraSolr/blob/master/lib/searchService.cfc#L409

<cfdump var="#rs#">
<cfdump var="#rsScore#">
<cfabort>

@JonnyHayes
Copy link
Author

        <th class="query" colspan="2" onclick="cfdump_toggleTable(this);" style="cursor:pointer;" title="click to collapse">query</th>
        </tr>
        <tr class="query" valign="top">
            <td class="query" style="cursor:pointer;" title="click to collapse" onclick="cfdump_toggleRow_qry(this);">RESULTSET</td>
            <td>
            <table class="cfdump_query">
            <tbody><tr>
        
            <th class="query" colspan="45" onclick="cfdump_toggleTable(this);" style="cursor:pointer;" title="click to collapse">query</th>
            </tr>
        
            <tr bgcolor="eeaaaa">
            <td class="query" style="cursor:pointer;" title="click to collapse" onclick="cfdump_toggleRow_qry(this);">&nbsp;</td>
            
            <td class="query">ASSOCFILENAME</td>
            
            <td class="query">AUDIENCE</td>
            
            <td class="query">COMMENTS</td>
            
            <td class="query">CONTENTHISTID</td>
            
            <td class="query">CONTENTID</td>
            
            <td class="query">CREATED</td>
            
            <td class="query">CREDITS</td>
            
            <td class="query">DISPLAYSTART</td>
            
            <td class="query">DISPLAYSTOP</td>
            
            <td class="query">DOWNVOTES</td>
            
            <td class="query">FILEEXT</td>
            
            <td class="query">FILEID</td>
            
            <td class="query">FILENAME</td>
            
            <td class="query">FILESIZE</td>
            
            <td class="query">KEYPOINTS</td>
            
            <td class="query">KIDS</td>
            
            <td class="query">LASTUPDATE</td>
            
            <td class="query">LOCKID</td>
            
            <td class="query">MAJORVERSION</td>
            
            <td class="query">MENUTITLE</td>
            
            <td class="query">MINORVERSION</td>
            
            <td class="query">NEXTN</td>
            
            <td class="query">ORDERNO</td>
            
            <td class="query">PARENTTYPE</td>
            
            <td class="query">PATH</td>
            
            <td class="query">RATING</td>
            
            <td class="query">RELEASEDATE</td>
            
            <td class="query">REMOTESOURCE</td>
            
            <td class="query">REMOTESOURCEURL</td>
            
            <td class="query">REMOTEURL</td>
            
            <td class="query">RESTRICTED</td>
            
            <td class="query">RESTRICTGROUPS</td>
            
            <td class="query">SCORE</td>
            
            <td class="query">SITEID</td>
            
            <td class="query">SORTDATE</td>
            
            <td class="query">SUBTYPE</td>
            
            <td class="query">SUMMARY</td>
            
            <td class="query">TAGS</td>
            
            <td class="query">TARGET</td>
            
            <td class="query">TARGETPARAMS</td>
            
            <td class="query">TITLE</td>
            
            <td class="query">TOTALVOTES</td>
            
            <td class="query">TYPE</td>
            
            <td class="query">UPVOTES</td>
            
            </tr>
            
            
            <tr>
            <td style="cursor:pointer;" title="click to collapse" onclick="cfdump_toggleRow_qry(this);" class="query">1</td>
            
            
                <td valign="top"> [empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">0 </td>
            
                <td valign="top">17BE8874-D067-E5E6-DC437B351AA190F4 </td>
            
                <td valign="top">37F83968-3ABD-4C84-8D99256FA2C828C5 </td>
            
                <td valign="top">2012-11-02 11:23:38.0 </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">oahu/guidebook/topics/beaches-of-oahu </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">0 </td>
            
                <td valign="top">2014-04-15 18:25:43.417 </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">Beaches of Oahu </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">10 </td>
            
                <td valign="top">8 </td>
            
                <td valign="top">Page </td>
            
                <td valign="top">00000000000000000000000000000000001,39036947-72A0-43CF-9432003AEDE31F31,157260C4-5F6E-4660-A1FE1B16B90C9379,253DFCF2-AFEC-44F0-B9E81C4E1A68BA88,37F83968-3ABD-4C84-8D99256FA2C828C5 </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">0 </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">0 </td>
            
                <td valign="top">en </td>
            
                <td valign="top">2012-11-02 11:23:38.0 </td>
            
                <td valign="top">Default </td>
            
                <td valign="top">&lt;p&gt;Oahu is home to world famous Waikiki Beach, the legendary North Shore and other amazing off-the-beaten-path beaches.&lt;/p&gt; </td>
            
                <td valign="top">Beaches, Oahu </td>
            
                <td valign="top">_self </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">Beaches of Oahu </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">Page </td>
            
                <td valign="top">[empty string] </td>
            
            </tr>
            
            <tr>
            <td style="cursor:pointer;" title="click to collapse" onclick="cfdump_toggleRow_qry(this);" class="query">2</td>
            
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">0 </td>
            
                <td valign="top">5E46802C-D067-E5E6-DC438E745C0B958C </td>
            
                <td valign="top">85C9474D-FD7F-4B55-ACC09CEF1BE02C83 </td>
            
                <td valign="top">2012-06-13 03:49:32.0 </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">statewide/choose-an-island </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">0 </td>
            
                <td valign="top">2014-02-11 12:19:23.34 </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">Choose an Island </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">10 </td>
            
                <td valign="top">6 </td>
            
                <td valign="top">Page </td>
            
                <td valign="top">00000000000000000000000000000000001,AA47582F-3636-4D9E-A84B4C5B1235A217,85C9474D-FD7F-4B55-ACC09CEF1BE02C83 </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">0 </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">0 </td>
            
                <td valign="top">en </td>
            
                <td valign="top">2012-06-13 03:49:32.0 </td>
            
                <td valign="top">Default </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">_self </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">Choose an Island </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">Page </td>
            
                <td valign="top">[empty string] </td>
            
            </tr>
            
            <tr>
            <td style="cursor:pointer;" title="click to collapse" onclick="cfdump_toggleRow_qry(this);" class="query">3</td>
            
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">0 </td>
            
                <td valign="top">11EE7853-D067-E5E6-DC43BB7B367D9263 </td>
            
                <td valign="top">B37C4E86-718C-4333-B86FA6CB2E02A10F </td>
            
                <td valign="top">2012-06-13 03:49:31.0 </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">statewide/discover/essential-hawaii/weddings-and-honeymoons </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">0 </td>
            
                <td valign="top">2014-04-15 15:43:10.97 </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">Hawaii Weddings and Honeymoons </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">10 </td>
            
                <td valign="top">10 </td>
            
                <td valign="top">Page </td>
            
                <td valign="top">00000000000000000000000000000000001,AA47582F-3636-4D9E-A84B4C5B1235A217,CCBF4383-22B9-4301-961E6299555C79F1,4C493632-F15D-4A1E-9B75F96CB1BE0E87,B37C4E86-718C-4333-B86FA6CB2E02A10F </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">0 </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">0 </td>
            
                <td valign="top">en </td>
            
                <td valign="top">2012-06-13 03:49:31.0 </td>
            
                <td valign="top">Default </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">_self </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">Hawaii Weddings and Honeymoons </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">Page </td>
            
                <td valign="top">[empty string] </td>
            
            </tr>
            
            <tr>
            <td style="cursor:pointer;" title="click to collapse" onclick="cfdump_toggleRow_qry(this);" class="query">4</td>
            
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">0 </td>
            
                <td valign="top">11E8E19F-D067-E5E6-DC43DD0234A4ADB9 </td>
            
                <td valign="top">CAA18337-7191-4911-ACA31B32F40E6E7F </td>
            
                <td valign="top">2012-11-05 08:54:28.0 </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">oahu/guidebook/topics/natural-wonders-of-oahu </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">0 </td>
            
                <td valign="top">2014-04-15 15:42:34.437 </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">Natural Wonders of Oahu </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">10 </td>
            
                <td valign="top">13 </td>
            
                <td valign="top">Page </td>
            
                <td valign="top">00000000000000000000000000000000001,39036947-72A0-43CF-9432003AEDE31F31,157260C4-5F6E-4660-A1FE1B16B90C9379,253DFCF2-AFEC-44F0-B9E81C4E1A68BA88,CAA18337-7191-4911-ACA31B32F40E6E7F </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">0 </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">0 </td>
            
                <td valign="top">en </td>
            
                <td valign="top">2012-11-05 08:54:28.0 </td>
            
                <td valign="top">Default </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">_self </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">Natural Wonders of Oahu </td>
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">Page </td>
            
                <td valign="top">[empty string] </td>
            
            </tr>
            
            </tbody></table>
            </td>
        </tr>


                    <tr bgcolor="eeaaaa">
                    <td class="query" style="cursor:pointer;" title="click to collapse" onclick="cfdump_toggleRow_qry(this);">CACHED</td>
                    <td>false </td>
                    </tr>

                    <tr bgcolor="eeaaaa">
                    <td class="query" style="cursor:pointer;" title="click to collapse" onclick="cfdump_toggleRow_qry(this);">EXECUTIONTIME</td>
                    <td>31 </td>
                    </tr>

                    <tr bgcolor="eeaaaa">
                    <td class="query" style="cursor:pointer;" title="click to collapse" onclick="cfdump_toggleRow_qry(this);">SQL</td>
                    <td>select tcontent.contentid,tcontent.contenthistid,tcontent.siteid,tcontent.title,tcontent.menutitle,tcontent.targetParams,tcontent.filename,tcontent.summary,tcontent.tags,
tcontent.restricted,tcontent.releaseDate,tcontent.type,tcontent.subType,
tcontent.restrictgroups,tcontent.target ,tcontent.displaystart,tcontent.displaystop,0 as Comments, 
tcontent.credits, tcontent.remoteSource, tcontent.remoteSourceURL, 
tcontent.remoteURL,tfiles.fileSize,tfiles.fileExt,tcontent.fileID,tcontent.audience,tcontent.keyPoints,
tcontentstats.rating,tcontentstats.totalVotes,tcontentstats.downVotes,tcontentstats.upVotes, 0 as kids, 
tparent.type parentType,tcontent.nextn,tcontent.path,tcontent.orderno,tcontent.lastupdate,tcontent.created,
tcontent.created sortdate, 0 score,tfiles.filename as AssocFilename,tcontentstats.lockID,tcontentstats.majorVersion,tcontentstats.minorVersion
from tcontent Left Join tfiles ON (tcontent.fileID=tfiles.fileID)
Left Join tcontent tparent on (tcontent.parentid=tparent.contentid
                                    and tcontent.siteid=tparent.siteid
                                    and tparent.active=1) 
LEFT JOIN tcontentstats ON (tcontent.contentid=tcontentstats.contentid
                        and tcontent.siteID=tcontentstats.SiteID)




    where

                    (tcontent.Active = 1 
                    AND tcontent.Approved = 1
                    AND tcontent.siteid = ? )

                    AND

                    (
                      tcontent.Display = 2 
                        AND 
                        (
                            (tcontent.DisplayStart &lt;= {d '2014-04-21'}
                            AND (tcontent.DisplayStop &gt;= {d '2014-04-21'} or tcontent.DisplayStop is null)
                            )
                            OR  tparent.type='Calendar'
                        )

                        OR tcontent.Display = 1
                    )


            AND
            tcontent.type in ('Page','Folder','Portal','Calendar','File','Link')

            AND tcontent.releaseDate is null


                and 
                (

                            0=1


                        or 


                            0=1


                        or


                            tcontent.contentID in (?,?,?,?)


                )


            and tcontent.searchExclude=0




union all



select tcontent.contentid,tcontent.contenthistid,tcontent.siteid,tcontent.title,tcontent.menutitle,tcontent.targetParams,tcontent.filename,tcontent.summary,tcontent.tags,
tcontent.restricted,tcontent.releaseDate,tcontent.type,tcontent.subType,
tcontent.restrictgroups,tcontent.target ,tcontent.displaystart,tcontent.displaystop,0 as Comments, 
tcontent.credits, tcontent.remoteSource, tcontent.remoteSourceURL, 
tcontent.remoteURL,tfiles.fileSize,tfiles.fileExt,tcontent.fileID,tcontent.audience,tcontent.keyPoints,
tcontentstats.rating,tcontentstats.totalVotes,tcontentstats.downVotes,tcontentstats.upVotes, 0 as kids, 
tparent.type parentType,tcontent.nextn,tcontent.path,tcontent.orderno,tcontent.lastupdate,tcontent.created,
tcontent.releaseDate sortdate, 0 score,tfiles.filename as AssocFilename,tcontentstats.lockID,tcontentstats.majorVersion,tcontentstats.minorVersion
from tcontent Left Join tfiles ON (tcontent.fileID=tfiles.fileID)
Left Join tcontent tparent on (tcontent.parentid=tparent.contentid
                                    and tcontent.siteid=tparent.siteid
                                    and tparent.active=1) 
Left Join tcontentstats on (tcontent.contentid=tcontentstats.contentid
                    and tcontent.siteid=tcontentstats.siteid) 



    where

                    (tcontent.Active = 1 
                    AND tcontent.Approved = 1
                    AND tcontent.siteid = ? )

                    AND

                    (
                      tcontent.Display = 2 
                        AND 
                        (
                            (tcontent.DisplayStart &lt;= {d '2014-04-21'}
                            AND (tcontent.DisplayStop &gt;= {d '2014-04-21'} or tcontent.DisplayStop is null)
                            )
                            OR  tparent.type='Calendar'
                        )

                        OR tcontent.Display = 1
                    )


            AND
            tcontent.type in ('Page','Folder','Portal','Calendar','File','Link')

            AND tcontent.releaseDate is not null


                and 
                (

                            0=1


                        or 


                            0=1


                        or


                            tcontent.contentID in (?,?,?,?)


                )


            and tcontent.searchExclude=0 </td>
                    </tr>

                    <tr bgcolor="eeaaaa">
                    <td class="query" style="cursor:pointer;" title="click to collapse" onclick="cfdump_toggleRow_qry(this);">SQLPARAMETERS</td>
                    <td>
            <table class="cfdump_array">
            <tbody><tr><th class="array" colspan="2" onclick="cfdump_toggleTable(this);" style="cursor:pointer;" title="click to collapse">array
            </th></tr>

                <tr><td class="array" onclick="cfdump_toggleRow(this);" style="cursor:pointer;" title="click to collapse">1</td>
                <td> en </td></tr> 
                <tr><td class="array" onclick="cfdump_toggleRow(this);" style="cursor:pointer;" title="click to collapse">2</td>
                <td> CAA18337-7191-4911-ACA31B32F40E6E7F </td></tr> 
                <tr><td class="array" onclick="cfdump_toggleRow(this);" style="cursor:pointer;" title="click to collapse">3</td>
                <td> B37C4E86-718C-4333-B86FA6CB2E02A10F </td></tr> 
                <tr><td class="array" onclick="cfdump_toggleRow(this);" style="cursor:pointer;" title="click to collapse">4</td>
                <td> 85C9474D-FD7F-4B55-ACC09CEF1BE02C83 </td></tr> 
                <tr><td class="array" onclick="cfdump_toggleRow(this);" style="cursor:pointer;" title="click to collapse">5</td>
                <td> 37F83968-3ABD-4C84-8D99256FA2C828C5 </td></tr> 
                <tr><td class="array" onclick="cfdump_toggleRow(this);" style="cursor:pointer;" title="click to collapse">6</td>
                <td> en </td></tr> 
                <tr><td class="array" onclick="cfdump_toggleRow(this);" style="cursor:pointer;" title="click to collapse">7</td>
                <td> CAA18337-7191-4911-ACA31B32F40E6E7F </td></tr> 
                <tr><td class="array" onclick="cfdump_toggleRow(this);" style="cursor:pointer;" title="click to collapse">8</td>
                <td> B37C4E86-718C-4333-B86FA6CB2E02A10F </td></tr> 
                <tr><td class="array" onclick="cfdump_toggleRow(this);" style="cursor:pointer;" title="click to collapse">9</td>
                <td> 85C9474D-FD7F-4B55-ACC09CEF1BE02C83 </td></tr> 
                <tr><td class="array" onclick="cfdump_toggleRow(this);" style="cursor:pointer;" title="click to collapse">10</td>
                <td> 37F83968-3ABD-4C84-8D99256FA2C828C5 </td></tr> 
        </tbody></table>
    </td>
                    </tr>

    </tbody></table>



        <th class="query" colspan="2" onclick="cfdump_toggleTable(this);" style="cursor:pointer;" title="click to collapse">query</th>
        </tr>
        <tr class="query" valign="top">
            <td class="query" style="cursor:pointer;" title="click to collapse" onclick="cfdump_toggleRow_qry(this);">RESULTSET</td>
            <td>
            <table class="cfdump_query">
            <tbody><tr>
        
            <th class="query" colspan="3" onclick="cfdump_toggleTable(this);" style="cursor:pointer;" title="click to collapse">query</th>
            </tr>
        
            <tr bgcolor="eeaaaa">
            <td class="query" style="cursor:pointer;" title="click to collapse" onclick="cfdump_toggleRow_qry(this);">&nbsp;</td>
            
            <td class="query">CONTEXT</td>
            
            <td class="query">SCORE</td>
            
            </tr>
            
            
            <tr>
            <td style="cursor:pointer;" title="click to collapse" onclick="cfdump_toggleRow_qry(this);" class="query">1</td>
            
            
                <td valign="top">[empty string] </td>
            
                <td valign="top">0.1623213 </td>
            
            </tr>
            
            </tbody></table>
            </td>
        </tr>


                    <tr bgcolor="eeaaaa">
                    <td class="query" style="cursor:pointer;" title="click to collapse" onclick="cfdump_toggleRow_qry(this);">CACHED</td>
                    <td>false </td>
                    </tr>

                    <tr bgcolor="eeaaaa">
                    <td class="query" style="cursor:pointer;" title="click to collapse" onclick="cfdump_toggleRow_qry(this);">EXECUTIONTIME</td>
                    <td>0 </td>
                    </tr>

                    <tr bgcolor="eeaaaa">
                    <td class="query" style="cursor:pointer;" title="click to collapse" onclick="cfdump_toggleRow_qry(this);">SQL</td>
                    <td>select score,context from rsDbSearch
        where contentID=? </td>
                    </tr>

                    <tr bgcolor="eeaaaa">
                    <td class="query" style="cursor:pointer;" title="click to collapse" onclick="cfdump_toggleRow_qry(this);">SQLPARAMETERS</td>
                    <td>
            <table class="cfdump_array">
            <tbody><tr><th class="array" colspan="2" onclick="cfdump_toggleTable(this);" style="cursor:pointer;" title="click to collapse">array
            </th></tr>

                <tr><td class="array" onclick="cfdump_toggleRow(this);" style="cursor:pointer;" title="click to collapse">1</td>
                <td> 37F83968-3ABD-4C84-8D99256FA2C828C5 </td></tr> 
        </tbody></table>
    </td>
                    </tr>

    </tbody></table>

@JonnyHayes
Copy link
Author

I modified final query at ln 431. (alias score as scorey)
I can now get correct scores -

select *, rsDbSearch.score as scorey
from rs , rsDbSearch
where rs.contentID = rsDbSearch.ContentID

    order by rsDbSearch.score desc, tags desc,  sortdate desc,  summary desc

</cfquery>

Thanks for that snippet - was looking in the wrong place. It was indeed returning the correct sort, just not displaying the correct score. However, for some reason my search pulls 3 other results ahead of a page with exact title, metadesc, and summary that matches my term. I can manipulate results with 'tags' but and sorting by tags first. I guess I just can't understand why solr can't see a pages with an exact term as most relevant.

@mattlevine
Copy link
Member

I think the issue is that query is treating the score column like an integer. I think the score value coming from solr needs to be multiplied by 1000 when added to the rs query variable.

Just an educated guess.

I see what you did by adding the join. I check that out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants