tracker issue : CF-4076735

select a category, or use search below
(searches all categories and all time range)

cfsearch with contextpassages throws a null pointer error when larger number of results are returned

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Susan Pitcher / Susan Pitcher (Susan Pitcher)

Created: 10/20/2015

Components: Text Search, Solr

Versions: 11.0

Failure Type: Non Functioning

Found In Build/Fixed In Build: CF11_Final /

Priority/Frequency: Major / Some users will encounter

Locale/System: English / Platforms All

Vote Count: 0

Listed in the version 2016.0.02.299200 Issues Fixed doc
Problem Description: If you use cfsearch with contextpassages attribute and larger results numbers are returned, the server throws a null pointer error. No descriptive information appears in any of the cf logs except the stack trace in the execution log . The solr output logs indicates the search completed, see note below, but while the 3 hits displayed as expected, the 70 hits resulted in a null pointer

Steps to Reproduce: create a solr collection.modify the schema and config files to support content display and context highlighting. index sufficient files you can get over 50 hits. run a search that returns smaller numbers. run a search that returns larger numbers.

Actual Result:the larger number of results gives a null pointer.

Expected Result: regardless of results returned, everyhting displayed. this was the case under cf 9

Any Workarounds:turn of context display and highlighting, this is a poor user experience for search.

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4076735

External Customer Info:
External Company:  
External Customer Name: Susan Pitcher
External Customer Email:  
External Test Config: My Hardware and Environment details: Windows 2008 R2 on VSphere wih 4 GB assigned memory.


  1. October 20, 2015 00:00:00: 1_log_snippets.txt
  2. October 31, 2015 00:00:00: 2_mycollectionTest.cfm


Susan, Thank you for raising this. Can we pls. discuss some specifics. In the "steps to reproduce", you've suggested modifying the config file to support context display and highlighting. Is there a reason you are are not using the ContextHighlightBegin/ContextHighlightEnd and ContextPassages attributes in the cfsearch tag to effect the same? Are you running into the issue when there are multiple occurrences of the search term in the one file or when they are spread across multiple files? Is the error consistently observed when the search returns over 50 hits, or is it sporadic? I've tried the following in on a standalone CF11,0,05,293506 on Win 7x64 <cfsearch name="srch_rslt" collection="#col_name#" criteria= "golden" ContextHighlightBegin="<b><font color='red'>" ContextHighlightEnd="</font></b>" ContextPassages="160" <!--- ContextBytes="1500" ---> > The returned srch_rslt query consistently returns 170 records (the no. of files with matched string) across multiple page hits. Would it be possible for you to share the relevant part of the file indicated in your log (E:\_Sites\HPP-Intranet\cf\home\search.cfm:8) so that we can have a closer look at the way your are using the search tag? You may share it here or mail it to Also, can you share the update level of your CF server. You will find that info in the settings summary of your CF server administrator console.
Comment by Piyush K.
5504 | October 25, 2015 08:36:15 AM GMT
We are experiencing the exact same issue. Though, I can recreate the issue regardless of the count of return results.. happens when: 1) the collection is indexed from a db query (not files) 1) contextPassages =1 attribute is set on cfsearch tag
Comment by External U.
5505 | October 30, 2015 12:04:18 PM GMT
see the attachment of a simple script that demos the issue with only 2 rows of data in a cfquery used to index the collection. This is the error thrown:
Comment by External U.
5506 | October 30, 2015 12:12:03 PM GMT
FYI: server platform details:
Comment by External U.
5507 | October 30, 2015 12:14:17 PM GMT
Version 11,0,05,293506 We are also populating the index from a database. Although as mentioned, with smaller numbers of results everything was fine. I did try varying the number of context passages with no change in behavior. Low results worked and displayed content context, higher numbers threw a null pointer. Piyush: The default solr config only lets you highlight the auto-generated summary, which is frequently nonsense. to support CONTENT highlight (was not emphasized in the original description) you have to follow the steps here:
Comment by External U.
5508 | October 30, 2015 12:26:08 PM GMT
sorry: error message was cutoff in first screenshot
Comment by External U.
5509 | October 30, 2015 12:28:44 PM GMT
FWIW, I'm unable to reproduce this on CF11 Update 7 (build 11,0,07,296330) using the attached mycollectionTest.cfm and the following: <cfscript> q = queryNew("key,title,body,category"); for(row=1; row<=10000; row++) { queryAddRow(q, [[row, 'title ' & row, 'text ' & row & ' ' & createUUID(), row%2?'category 1':'category 2']]); } </cfscript> <cfindex action="update" collection="ticketCF-4076735" query="q" key="key" title="title" body="body" category="category" status="status"> <cfdump var="#status#"> <cfsearch name="result" collection="ticketCF-4076735" criteria="text" contexthighlightbegin="<b><font color='red'>" contexthighlightend="</font></b>" contextpassages="10000"> <cfdump var="#result.RecordCount#"> Thanks!, -Aaron
Comment by External U.
5510 | December 05, 2015 05:03:30 AM GMT
Aaron, I would not expect the error to occur in your scenario. When the context highlight is against the default-setting solr generated summary, everything is fine. It is when, AFTER creating the solr collection, that one performs the steps listed in the previously referenced forum so that context highlighting displays the CONTENT passages that the error occurs. My best guess it this point is that it is memory related. But it did work just fine, against the same content on an older server, under CF 9. Since it is a standard solr behavior and not an undocumented hack I'm hoping Adobe will address.
Comment by External U.
5511 | December 07, 2015 08:21:09 AM GMT
Scott, The "null pointer exception" was due to a space in one of the key entries in the query being indexed: It's the following line in the mycollectionTest.cfm test case you shared. <cfset temp = QuerySetCell(getAttributes, "PSSKU", "foo ", 2)> This is fixed. This condition will now be handled and the exception will not be thrown. Susan, Since, the exception stack trace signature you shared seems to be exactly the same as in the case of Scott's test case, the underlying cause could be the same. Can you please check for similar condition your code. More specifically, the query that you are indexing may contain data with trailing or leading spaces.
Comment by Piyush K.
5512 | May 03, 2016 07:44:11 AM GMT
test note
Comment by CFwatson U.
5513 | June 07, 2016 04:19:43 AM GMT
The fix for this bug is available as part of the early-access build for ColdFusion 2016 Update 2.
Comment by CFwatson U.
5514 | June 07, 2016 04:26:41 AM GMT