Title:
[ANeff] Bug for: cfsearch term highlighting is an absolute mess to get working correctly
| View in TrackerStatus/Resolution/Reason: To Fix//Investigate
Reporter/Name(from Bugbase): Aaron Neff / ()
Created: 05/30/2018
Components: Text Search, Solr
Versions: 2018
Failure Type: Enhancement Request
Found In Build/Fixed In Build: 2018.0.01.308605 (PreRelease) /
Priority/Frequency: Normal / Some users will encounter
Locale/System: / Platforms All
Vote Count: 0
Issue: cfsearch term highlighting is an absolute mess to get working correctly
Steps to Reproduce:
Application.cfc
-----------
component {
THIS.name = "MyApp"
public boolean function onRequestStart() {
if(URL.keyExists("reinit")) {
cfcollection(action="list", name="allCollections")
if(!allCollections.valueArray("name").findNoCase("MyCollection")) {
cfcollection(action="create", collection="MyCollection")
}
myQuery = queryNew("collectionKey,collectionTitle,collectionBody", "varchar,varchar,varchar", [[1,"Term highlighting with Adobe ColdFusion 2018 Release","By default, Solr highlights searched terms in the summary content. Not even the title (even tho solrconfig.xml defaults to 'summary title'), just the summary! This is pointless because that summary is just the first 100 or so characters of content. To correct this bogus behavior you must do many steps: 1) On CF Admin's collections page, click on the collection and then click the 'Enable' Term Highlighting button, 2) That page says the collection will need reindexed, but it doesn't go ahead and re-index for you, 3) On CF Admin's Collections page, see there is no 'Re-index' button, but there is an 'Index' button, 4) Click the 'Index' button, 5) Under 'Index Collection', click the 'Submit' button, 6) See error 'Please enter a valid Directory Path for this collection.', 7) Laugh in annoyance, 8) Run cfindex(action='refresh', ..), 9) See Term Highlighting still only highlights the useless Summary, 10) Think to yourself: 'Should I also click the Reload button on the Collectons page?', 11) Yes, LOL, do that, 12) NOW see Term Highlighting finally highlights terms in the document. Note: Clicking CF Admin's 'Reload' alone doesn't resolve the issue; you must also do cfindex(action='refresh', ..) Doh!! Now stop wasting your time w/ CF's shenanigans and backwards behavior and go do something useful with your time :)"]])
cfindex(action="refresh", collection="MyCollection", query="myQuery", key="collectionKey", title="collectionTitle", body="collectionBody")
}
return true;
}
}
index.cfm
-----------
<cfscript>
cfparam(name="URL.type", default="standard")
cfparam(name="URL.criteria", default="")
cfsearch(name="cfsearchResult", collection="MyCollection", type=URL.type, criteria=URL.criteria, contextpassages="1")
writeDump(cfsearchResult)
</cfscript>
1) Run above app w/ ?reinit URL parameter to create/index "MyCollection" collection
2) Run above app w/ ?criteria=button and see cfdump shows empty Context
3) On CF Admin's Collections page, click the collection and click 'Enable' Term Highlighting. See the page says collection must be re-indexed, but it doesn't go ahead and re-index for you.
4) On CF Admin's Collections page, click the "Index" (since there's no "Re-index" button) button.
5) Under "Index Collection", click "Submit" and see error "Please enter a valid Directory Path for this collection." and get annoyed :)
6) Run above app w/ ?reinit URL parameter to re-index "MyCollection" collection
7) Run above app w/ ?criteria=button and see cfdump shows empty Context
8) On CF Admin's Collections page, click the "Reload Collection" button
9) Run above app w/ ?criteria=button and see cfdump finally shows Context content!
Note: steps #6 and #8 can be flipped and result is the same
Question: WHY!?!?!?!? That summary content is always the first 100 characters, or so, of content. It's USELESS for Term Highlighting.
Suggestion: Just make 'content title' be the default! And remove all the above nonsense/unnecessary steps.
Especially since those on shared hosting don't even have CF Admin access, and so they're stuck w/ that useless Summary term highlighting :/
Attachments:
Comments: