3

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:

  <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:

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

edit: Moved requested XML provided in comments to the question

<fieldType name="text_areios_pagos" class="solr.TextField" positionIncrementGap="100">
    <analyzer type="index">
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_en.txt" enablePositionIncrements="true"/>
        <filter class="solr.LowerCaseFilterFactory"/> 
        <filter class="solr.EnglishPossessiveFilterFactory"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_el.txt" enablePositionIncrements="true"/>
        <filter class="solr.GreekLowerCaseFilterFactory"/>
        <filter class="solr.GreekStemFilterFactory"/>
        <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
        <filter class="solr.PorterStemFilterFactory"/>
    </analyzer>
    <analyzer type="query">
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_en.txt" enablePositionIncrements="true"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_el.txt" enablePositionIncrements="true"/>
        <filter class="solr.GreekLowerCaseFilterFactory"/>
        <filter class="solr.GreekStemFilterFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.EnglishPossessiveFilterFactory"/>
        <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/> 
        <filter class="solr.PorterStemFilterFactory"/>
    </analyzer>
</fieldType>
genericHCU
  • 4,394
  • 2
  • 22
  • 34
  • does it work if you search without special characters? – Matt Busche Jan 03 '13 at 16:19
  • 1
    Nothing to do with your problem but I noticed that your cfargument tags have required="yes" and default values. Doesn't one defeat the purpose of the other? – Dan Bracuk Jan 03 '13 at 17:24
  • @Dan Bracuk I have removed "default" and "required" directive but it doesn't work! –  Jan 03 '13 at 17:41
  • @Matt Busche What kind of special characters do you mean? –  Jan 03 '13 at 17:42
  • @anarchos78 the non English characters like `ΠΟΛΙΤΙΚΕΣ` – Matt Busche Jan 03 '13 at 17:48
  • @Matt Busche With "ΠΟΛΙΤΙΚΕΣ" or "ΠΟΙΝΙΚΕΣ" is working! Its not working with "3068" –  Jan 03 '13 at 18:19
  • How is the `apofasi_taxonomy` field defined in the Solr schema.xml? Please add the `` entry for this field as well as the corresponding `` as defined by the `type` property to your question. It could be that field definition is not indexing/querying numbers properly. – Paige Cook Jan 03 '13 at 18:31
  • @Paige Cook The `` definition: ``. The ``:`` –  Jan 03 '13 at 18:40
  • Thanks, but that is not the entire fieldType definition, can you include everything between the `` and `` entries. – Paige Cook Jan 03 '13 at 18:52
  • @Paige Cook You will see three(3) part. Please throw it to a XML beautifier –  Jan 03 '13 at 18:58
  • @Paige Cook –  Jan 03 '13 at 18:59
  • @Paige Cook –  Jan 03 '13 at 19:00
  • @Paige Cook –  Jan 03 '13 at 19:01
  • @Paige Cook It has nothing to do with solr. As i already told if i query solr like: `http://localhost/solr/areios_pagos/select/?q=blahblah&fq=apofasi_taxonomy:(3068)+apofasi_tmima:(Α || Ζ)+apofasi_date:(2007 || 2012)+apofasi_number:(666)` it is working the problem is on ColdFusion side –  Jan 03 '13 at 19:25
  • Thanks @Travis for adding the xml to the question, much easier to read:) Sorry, it was not clear from your question that the Solr side is working properly. – Paige Cook Jan 03 '13 at 19:35
  • @anarchos78 have you attempted to output `#apofasi_taxonomy#+#apofasi_tmima#+#apofasi_date#+#apofasi_number#` to see if it is exactly as you expect it? that is, does it = `apofasi_taxonomy:(3068‌​)+apofasi_tmima:(Α || Ζ)+apofasi_date:(2007 || 2012)+apofasi_number:(666)` as you searched for it in solr? – genericHCU Jan 03 '13 at 19:39
  • @Travis I haven't tested that. Is ther a way to see what is the `cfhttp` object is formed? I don't know how to do it. –  Jan 03 '13 at 19:50
  • try `#apofasi_taxonomy#+#apofasi_tmima#+#apofasi_date#+#apofasi_number#` just before your cfhttp tag if that doesn't work use `` just before the cfhttp tag – genericHCU Jan 03 '13 at 20:00
  • @Travis it is outputting well. I will try to re-check solr side. Thanks –  Jan 03 '13 at 20:29

1 Answers1

0

You may have to add a charset attribute to your cfhttp tag

    <cfhttp ... charset="ISO-8859-7" ...
Tim Garver
  • 61
  • 4