5

While trying to change server from CF8 to CF10, this happened

In CF8 this was the search code

<cfsearch 
    collection="test_#arguments.cabinetid#" 
    status="docsearchstatus" 
    name="docsearch" 
    criteria='#arguments.filter#' 
    suggestions="Always" 
    contextpassages="1" 
    contextbytes="300"
>

In CF10 this I am using this.

<cfsearch collection="test_#arguments.cabinetid#"
    status="docsearchstatus" 
    name="docsearch" 
    criteria='#lcase(arguments.filter)#*' 
    suggestions="Always" 
    contextPassages="1" 
    contextBytes="300"
>

Context filed in verity is longer and more descriptive. But while using solr most of times context is empty.
I tried making some changes on solr.xml and other solr config files. Here we add collections dynamically. So cannot fix this by changing the config files.

Have anyone come across this???

Result form verity searching Result form verity searching

Result from SOLR searching Result from SOLR searching

Community
  • 1
  • 1
rrk
  • 15,677
  • 4
  • 29
  • 45

1 Answers1

8

Solr doesn't populate context passages by default like Verity did. You need to tweak the config as described here in order to switch it on.

(Quoted from Adobe's help site in entirety, because they keep changing their URLs.)

To highlight contents in the entire document, modify the solrconfig.xml and schema.xml files. These files are available in the following locations:

  • <Solr Home>/multicore/template/conf: Modify files in this location to apply the changes to all future Solr collections. <Collection
  • <Collection Directory>/conf: Modify files in this location to apply the changes only to a particular collection.
  1. Stop ColdFusion Add-on services.

  2. Replace the following section in the solrconfig.xml, in the <requestHandler name="standard" and <requestHandler name="dismax" sections.

    <str name="hl.fl">summary title</str>  
    

    with

    <str name="hl.fl">contents title</str>
    
  3. Replace the following section in the schema.xml

    <field name="contents" type="text" indexed="true" stored="false" required="false" multiValued="true" omitNorms="true"/>
    

    with

    <field name="contents" type="text" indexed="true" stored="true" required="false" multiValued="true" omitNorms="true"/>
    
  4. Restart Solr (i.e. the ColdFusion Add-on services).

  5. Reindex the collection.

Note: The modifications to solrconfig.xml and schema.xml will increase the index size.

Once these changes are made the context passages should start to display.

Tomalak
  • 332,285
  • 67
  • 532
  • 628
Andrew Myers
  • 650
  • 5
  • 9
  • I made these changes and reindexed. But nothing changes. I am not sure I am doing it right. – rrk Sep 25 '13 at 13:32
  • Have you restarted Solr? Necessary for solrconfig.xml changes to take effect. – CfSimplicity Sep 25 '13 at 14:04
  • I am using Jetty. I restarted the service Coldfusion Jetty Service. – rrk Sep 25 '13 at 14:08
  • Try deleting and then re-creating the collection. The existing one may not be using the updated config (each collection has its own file copied from the template). – CfSimplicity Sep 25 '13 at 14:14
  • @CfSimplicity : when I am doing the search with jetty on "127.0.0.1:8985/solr/" the results are showing up. But not when I do coldfusion search. – rrk Sep 25 '13 at 14:17
  • 2
    Did you re-create the collection? Check the individual solrconfig.xml for that collection (in the conf/ folder within the specific Path for that collection). Make sure that `contents` is present. – CfSimplicity Sep 25 '13 at 14:20
  • @CfSimplicity : Yes, recreating the index worked. Now the text is coming, but still not the same as it was on verity. Anyway it it should be enough. And also `contents` is not in the exact fashion `contents title ` this is what I have. – rrk Sep 25 '13 at 15:11