Hey Sajal,
I ended up finding the location of that utility on my own through the coldfusion administrator.
I found some code on the internet as well.
<cfif isdefined("url.create")>
<cfcollection action="create" categories="yes" collection="sitecontent2" engine="solr" path="#expandpath('./')#">
Collection created OK.
</cfif>
<cfif isdefined("url.index")>
<cfset mq = queryNew("id,camera,cameratype,price","integer,varchar,varchar,varchar")>
<cfset tmp = queryAddRow(mq,5)>
<cfset tmp = querySetCell(mq,"id",1,1)>
<cfset tmp = querySetCell(mq,"id",2,2)>
<cfset tmp = querySetCell(mq,"id",3,3)>
<cfset tmp = querySetCell(mq,"id",4,4)>
<cfset tmp = querySetCell(mq,"id",5,5)>
<cfset tmp = querySetCell(mq,"camera","Olympus 500",1)>
<cfset tmp = querySetCell(mq,"camera","Canon D30",2)>
<cfset tmp = querySetCell(mq,"camera","Konica Minolta Dimage A2",3)>
<cfset tmp = querySetCell(mq,"camera","Sony Cybershot 300X",4)>
<cfset tmp = querySetCell(mq,"camera","Sony Cybershot 50D2",5)>
<cfset tmp = querySetCell(mq,"price","1499",1)>
<cfset tmp = querySetCell(mq,"price","1500",2)>
<cfset tmp = querySetCell(mq,"price","700",3)>
<cfset tmp = querySetCell(mq,"price","200",4)>
<cfset tmp = querySetCell(mq,"price","1400",5)>
<cfset tmp = querySetCell(mq,"cameratype","Professional",1)>
<cfset tmp = querySetCell(mq,"cameratype","Pro",2)>
<cfset tmp = querySetCell(mq,"cameratype","SLR",3)>
<cfset tmp = querySetCell(mq,"cameratype","SLR",4)>
<cfset tmp = querySetCell(mq,"cameratype","Pocket",5)>
Query to be indexed:
<cfdump var="#mq#">
Indexing...
<cfindex action="update" collection="sitecontent2" body="camera,cameratype,price" key="id" type="custom" query="mq" title="camera" custom1="price" custom2="cameratype">
OK<BR>
</cfif>
<cfif isdefined("url.search")>
<cfsearch collection="sitecontent2" name="mysearch1" criteria="custom1:700 TO 1500">
Search 1:
<cfdump var="#mysearch1#">
<cfsearch collection="sitecontent2" name="mysearch2" criteria="custom2:pro">
Search 2:
<cfdump var="#mysearch2#">
<cfsearch collection="sitecontent2" name="mysearch3" criteria="custom1:700 TO 1500 AND custom2:pro">
Search 3:
<cfdump var="#mysearch3#">
</cfif>
You can see how the “key” is set to an “integer” here. However, under that SOLR utility, it says “Field Type: STRING”. For custom1, it says the field type is TEXT. I am not sure if there is any way to change a field to have an integer type?
I found it strange how the code example’s price column was set to varchar instead of integer.
I noticed “custom1:700 TO 1500” will return keys 3 and 2. However, “custom1:700 TO 1499” will return keys 3 and 1. Obviously the 1499 key should be returned when the range is 700 to 1500 but it’s not. Why is this?
Thanks for anymore information. I would really love to figure this out so I can finish my product section.
By the way, I am willing to pay for assistance with this:
http://www.vworker.com/RentACoder/misc/BidRequests/ShowBidRequest.asp?lngBidRequestId=1474266
Sincerely,
Travis Walters