tracker issue : CF-3338790

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

OrmSearch does not include result score + entity for queries generating a single result

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/CannotReproduce

Reporter/Name(from Bugbase): Lewis Stewart / Lewis Stewart (Lewis Stewart)

Created: 09/28/2012

Components: ORM Support

Versions: 10.0

Failure Type:

Found In Build/Fixed In Build: Final /

Priority/Frequency: Major / All users will encounter

Locale/System: English / Linux All

Vote Count: 0

Problem Description:

When an OrmSearch() query returns a single result, that result is not included in the "data" array of the result object.

Steps to Reproduce:

Execute an OrmSearch which returns a single result (for example you could make the entity pk indexable + untokenized, and search for that, though any single result query has the same outcome).

  var results = OrmSearch( "id:1234", "TestEntity" );
  writedump( results );

  struct
      DATA    array [empty]
      MaxTotalCount    1

I have confirmed using other tools that the Lucene query returns a single result against the indices built using OrmIndex().

Actual Result:

    results.maxTotalCount is 1, but results.data is an empty array

Expected Result:

    results.maxTotalCount is 1, and results.data is an array with a single entry representing that result (score,entity).

Any Workarounds:

    no workaround found

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

Watson Bug ID:	3338790

External Customer Info:
External Company:  
External Customer Name: uncalc
External Customer Email:  
External Test Config: My Hardware and Environment details:



Server Product	 ColdFusion

Version	 ColdFusion 10,282462

Edition	 Enterprise (Trial)  

Operating System	 UNIX  

OS Version	 2.6.32-279.1.1.el6.x86_64  

Update Level	 /opt/coldfusion10/cfusion/lib/updates/chf10000002.jar  

Adobe Driver Version	 4.1 (Build 0001)

Attachments:

Comments:

Ignore me - turns out "offset" was 1, rather than 0.
Comment by External U.
17859 | September 28, 2012 10:49:07 AM GMT
Tried below steps and results.data returns valid result Application.cfc <cfset this.name = "search_indexing_basic_primary_pk"> <cfset this.ormenabled = "true"> <cfset this.datasource = "ORM_DDL"> <cfset this.ormsettings.dbcreate = "dropcreate"> <cfset this.ormsettings.searchenabled="true"> <cfset this.ormsettings.search.autoindex="true"> <cfset this.ormsettings.search.indexDir=""> orders.cfc <cfcomponent persistent="true" table="products" indexable="true"> <cfproperty name="productid" fieldtype="id"> <cfproperty name="prodname" indexable="true"> </cfcomponent> test.cfm <cfscript> ormreload();ormindexpurge(); obj = new orders(); obj.setProductid(1); obj.setProdname("First Product"); entitysave(obj); ormflush(); results = ORMSearch("productid:1","orders"); writedump(results.maxTotalCount); writedump(results.data); </cfscript> Ouptut - > results.data is an array with a single entry having the score and the entity Is this the way you are inserting data, if not please give us the script that can help us to repro this issue. (Comment added from ex-user id:nawani)
Comment by Adobe D.
17860 | September 26, 2013 04:08:36 AM GMT
Since there has been no response, closing the bug. If you still face this issue please let us know, the bug would be reopened (Comment added from ex-user id:nawani)
Comment by Adobe D.
17861 | December 03, 2014 05:07:47 AM GMT