1 Reply Latest reply on May 3, 2013 2:47 PM by Sham HC

    Property boosting in Search in CQ5 Version 5.5 SP2 not working

    alok.sharma

      I have a use-case where in I have to boost certain properties to get a higher score value in search. Following is the rule section I have used for the same.

       

      <index-rule nodeType="nt:unstructured">

                   <property boost="10">dc:title</property>

                   <property boost="5">dc:description</property>

      </index-rule>

       

      I created a sample data of about 10 DOC files in DAM having the below values for the Title and Description properties.

       

      Document 1:-

           Title: TestWord1 TestWord2 TestWord3

           Description: TestWord4 TestWord5 TestWord6

      Document 2:-

           Title: TestWord4 TestWord5 TestWord6

           Description: TestWord1 TestWord2 TestWord3

      Document 3:-

           Title: TestWord1 TestWord2 TestWord3

           Description: TestWord1 TestWord2 TestWord3

       

      Search Term Used: TestWord1

       

      Even with the property boosting in place the score for Document 1 and Document 2 is coming same. Ideally with the boosting in place the order must have been:

      1. Document 3
      2. Document 1
      3. Document 2

       

      The complete indexing_config.xml used is as follows:

      <?xml version="1.0"?>

                <!DOCTYPE configuration SYSTEM "http://jackrabbit.apache.org/dtd/indexing-configuration-1.2.dtd">

                <configuration

                xmlns:cq="http://www.day.com/jcr/cq/1.0"

                xmlns:dam="http://www.day.com/dam/1.0"

                xmlns:nt="http://www.jcp.org/jcr/nt/1.0"

                xmlns:jcr="http://www.jcp.org/jcr/1.0"

                xmlns:dc="http://purl.org/dc/elements/1.1/"

                xmlns:sling="http://sling.apache.org/jcr/sling/1.0">

                 <!-- Do not index content of subassets -->

                <index-rule nodeType="nt:resource"

                condition="ancestor::subassets/@jcr:primaryType='{http://www.jcp.org/jcr/nt/1.0}unstructured'">

                </index-rule>

                 <!--

                Exclude some well known properties from the node scope

                fulltext index. Do not add rules below this one, since

                this rule matches any node and acts as a default/fallback.

                -->

                <index-rule nodeType="nt:base">

                <property nodeScopeIndex="false">analyticsProvider</property>

                <property nodeScopeIndex="false">analyticsSnippet</property>

                <property nodeScopeIndex="false">hideInNav</property>

                <property nodeScopeIndex="false">offTime</property>

                <property nodeScopeIndex="false">onTime</property>

                <property nodeScopeIndex="false">cq:allowedTemplates</property>

                <property nodeScopeIndex="false">cq:childrenOrder</property>

                <property nodeScopeIndex="false">cq:cugEnabled</property>

                <property nodeScopeIndex="false">cq:cugPrincipals</property>

                <property nodeScopeIndex="false">cq:cugRealm</property>

                <property nodeScopeIndex="false">cq:designPath</property>

                <property nodeScopeIndex="false">cq:isCancelledForChildren</property>

                <property nodeScopeIndex="false">cq:isDeep</property>

                <property nodeScopeIndex="false">cq:lastModified</property>

                <property nodeScopeIndex="false">cq:lastModifiedBy</property>

                <property nodeScopeIndex="false">cq:lastPublished</property>

                <property nodeScopeIndex="false">cq:lastPublishedBy</property>

                <property nodeScopeIndex="false">cq:lastReplicated</property>

                <property nodeScopeIndex="false">cq:lastReplicatedBy</property>

                <property nodeScopeIndex="false">cq:lastReplicationAction</property>

                <property nodeScopeIndex="false">cq:lastReplicationStatus</property>

                <property nodeScopeIndex="false">cq:lastRolledout</property>

                <property nodeScopeIndex="false">cq:lastRolledoutBy</property>

                <property nodeScopeIndex="false">cq:name</property>

                <property nodeScopeIndex="false">cq:parentPath</property>

                <property nodeScopeIndex="false">cq:segments</property>

                <property nodeScopeIndex="false">cq:siblingOrder</property>

                <property nodeScopeIndex="false">cq:template</property>

                <property nodeScopeIndex="false">cq:trigger</property>

                <property nodeScopeIndex="false">cq:versionComment</property>

                <property nodeScopeIndex="false">jcr:createdBy</property>

                <property nodeScopeIndex="false">jcr:lastModifiedBy</property>

                <property nodeScopeIndex="false">sling:alias</property>

                <property nodeScopeIndex="false">sling:resourceType</property>

                <property nodeScopeIndex="false">sling:vanityPath</property>

                <property isRegexp="true">.*:.*</property>

                </index-rule>

                 <!-- Cq Page for jcr:contains(jcr:content, "...") searches -->

                <aggregate primaryType="cq:PageContent">

                <include>*</include>

                <include>*/*</include>

                <include>*/*/*</include>

                <include>*/*/*/*</include>

                </aggregate>

                 <aggregate primaryType="dam:Asset">

                <include>jcr:content</include>

                <include>jcr:content/metadata</include>

                <include>jcr:content/metadata/*</include>

                </aggregate>

                 <!-- nt:file child axis orderby index -->

                <aggregate primaryType="nt:file">

                <include>jcr:content</include>

                <include>jcr:content/jcr:lastModified</include>

                </aggregate>

                 <!-- cq:Page child axis orderby index -->

                <aggregate primaryType="cq:Page">

                <include>jcr:content</include>

                <include>jcr:content/cq:lastModified</include>

                </aggregate>

                 <!-- add your project specific search indexing configuration here -->

                 <index-rule nodeType="nt:unstructured">

                   <property boost="10">dc:title</property>

                   <property boost="5">dc:description</property>

                 </index-rule>

       

                 <index-rule nodeType="dam:Asset">

                   <property boost="10">dc:title</property>

                   <property boost="5">dc:description</property>

                   <property boost="20">inventorytype</property>

                 </index-rule>

                </configuration>