Solr Admin Results Are Always Correct And CFSEARCH Results Only Work On Single Keyword Searches
I'm starting a new thread on this because I discovered my first approach would not work for all possible Solr syntaxes; some of which we difinitely need in our application.
Basically, we are now taking a variable value from a forms code as shown below:
<INPUT TYPE="hidden" NAME="keywords" VALUE="#Form.keywords#">
Then we are populating CFSEARCH with the syntax for a given query by using encodeForURL & decodeFromURL where appropriate in the application.
So our CFSEARCH code is: Note: We have included an <cfoutput><cfabort> line of code for testing.
******************************************
<CFSEARCH NAME="applicants_#var#"
COLLECTION="Resumes"
TYPE="standard"
CRITERIA="#encodeForURL( Form.keywords)#">
<cfoutput>#applicants_test.recordcount#</cfoutput><cfabort>
******************************************
The output shows we are using the solr syntax needed for a given search.
However, the only time where we get the correct number of hits is when we use a single keyword in the search. More complex searches involving mutlitple keywords and/or special characters give us ridiculously high results.
Obviously, I am missing something that is key to producing the accurate results that the Solr Admin tool query tool always provides.
To be more precise I have discovered that the use of any quotes beyond the quotes that are required at the beginning & end of a given syntax or spaces or special characters such as a ? * "~ + or - character will give us high results or cause an error for the search.
For example a search on "unix" AND "linux" renders 3685 hits using the Solr Admin query tool & on our CF 4.51 production server running Verity searches. So we know the results are accurate.
However, using the CF 2023 CFSEARCH code described above we get 43586 hits! About 80% of our collection!
Frankly, at this point I am dead in the water. Can someone please tell me where my problem is and how to overcome it. Thank you very much in advance.
