CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   ColdFusion (http://www.codingforums.com/forumdisplay.php?f=45)
-   -   Very strange behaviour with cfhttp an cfhttpparam (http://www.codingforums.com/showthread.php?t=285220)

anarchos78 01-03-2013 07:43 PM

Very strange behaviour with cfhttp an cfhttpparam
 
Happy New Year,

The New Year found me wrestling with a coding problem. I am using ColdFusion and as for CFML engine “openBD”. I have a CFC that handles requests for the

search engine that I use (SOLR search engine). I am “feeding” that CFC with some arguments. The CFC performs as it should. But when I am trying to pass a

specific argument (#apofasi_taxonomy #) the CFC doesn’t returns nothing (If I pass the above argument directly to the search engine –not using CFC- I can

see return/search results)

Part of CFC:

Code:

  <cffunction name="searchP" access="remote" returnFormat="json">       
      <cfargument name="q" type="string" default="" required="yes">
      <cfargument name="apofasi_taxonomy" type="string" default="apofasi_taxonomy:(*)" required="yes">
      <cfargument name="apofasi_tmima" type="string" default="apofasi_tmima:(*)" required="yes">
      <cfargument name="apofasi_date" type="string" default="apofasi_date:(*)" required="yes"> 
      <cfargument name="apofasi_number" type="string" default="apofasi_number:(*)" required="yes">
      <!---<cfargument name="apofasi_taxonomy" type="string" default="*">
      <cfargument name="apofasi_tmima" type="string" default="*">
      <cfargument name="apofasi_date" type="string" default="*"> 
      <cfargument name="apofasi_number" type="string" default="*">--->

      <cfset theUrl = 'http://localhost/solr/areios_pagos/select/?'>

      <cfhttp method="get" url="#theUrl#" port="8090" result="rs" username="abcd" password="********">
        <cfhttpparam type="url" name="q" value="#q#">
        <cfhttpparam type="url" name="fq" value="#apofasi_taxonomy#+#apofasi_tmima#+#apofasi_date#+#apofasi_number#">
        <!---<cfhttpparam type="url" name="fq" value="apofasi_taxonomy:(3068 || ΠΟΙΝΙΚΕΣ) AND apofasi_date:(2010)">--->       
        <!---<cfhttpparam type="url" name="fq" value="apofasi_taxonomy:(3068) AND apofasi_date:(*) AND apofasi_number:(*)">--->
        <cfhttpparam type="url" name="rows" value="120">
        <cfhttpparam type="url" name="wt" value="json">
        <cfhttpparam type="url" name="sort" value="score desc">
        <cfhttpparam type="url" name="hl" value="true">
        <cfhttpparam type="url" name="hl.fl" value="content,title">
        <cfhttpparam type="url" name="fl" value="grid_title,title,url,ida,model,search_tag,solr_id">
        <cfhttpparam type="url" name="f.content.hl.alternateField" value="content">
        <cfhttpparam type="url" name="hl.maxAlternateFieldLength" value="800">
      </cfhttp>

Notice that the search engine consumes urls like:

Code:

http://localhost/solr/areios_pagos/select/?q=blahblah&fq=apofasi_taxonomy:(3068)+apofasi_tmima:(Α || Ζ)+apofasi_date:(2007 || 2012)+apofasi_number:(666)
What I have checked until now: The arguments that I am passing to CFC are 100% OK (from html), I have double-checked if the search engine can consume the

above url syntax. But I have noticed a very strange behavior. When I exclude the #apofasi_taxonomy# or #apofasi_tmima# arguments from the

url completely the CFC is working (it returns results). The values that #apofasi_taxonomy# argument takes are: apofasi_taxonomy\:\(ΠΟΙΝΙΚΕΣ), apofasi_taxonomy\:\(ΠΟΛΙΤΙΚΕΣ), apofasi_taxonomy\:\(3068) or apofasi_taxonomy\:\(ΠΟΙΝΙΚΕΣ || 3068), apofasi_taxonomy\:\(ΠΟΙΝΙΚΕΣ || ΠΟΛΙΤΙΚΕΣ) and so on.

I have noticed one more thing, #apofasi_taxonomy# argument is working with the values below: apofasi_taxonomy\:\(ΠΟΙΝΙΚΕΣ), apofasi_taxonomy\:\(ΠΟΛΙΤΙΚΕΣ) and apofasi_taxonomy\:\(ΠΟΛΙΤΙΚΕΣ || ΠΟΙΝΙΚΕΣ) but it is not working for apofasi_taxonomy\:\(3068), apofasi_taxonomy\:\(ΠΟΛΙΤΙΚΕΣ || 3068), apofasi_taxonomy\:\(ΠΟΛΙΤΙΚΕΣ || 3068) or apofasi_taxonomy\:\(ΠΟΛΙΤΙΚΕΣ || ΠΟΛΙΤΙΚΕΣ || 3068). Isn’t that weird?

The values that #apofasi_tmima# argument takes are: Α || Α1 || Α2 || Β || Β2 || Γ || Δ || Ε || ΣΤ || Ζ || ΟΛΟΜΕΛΕΙΑ e.g. apofasi_tmima\:\(Β || Β2 || ΟΛΟΜΕΛΕΙΑ).

Keep in mind that the above values are in Greek language.

Is there anyone out there that can help?

With respect,
Tom

WolfShade 01-03-2013 08:27 PM

Have you tried #URLEncodedFormat()# on the values?


All times are GMT +1. The time now is 06:33 PM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.