cancel
Showing results for 
Search instead for 
Did you mean: 

Advance Search by Size

mcasanket
Champ on-the-rise
Champ on-the-rise
Hi all!  Smiley Very Happy
  In one requirement of alfresco share 3.4.4 I need to implement the Advance Search by Size.  How can I do it.

Until now I have done the following.
In share-config.xml

<config evaluator="string-compare" condition="AdvancedSearch">
      <advanced-search>
         <forms>
            <form labelId="search.form.label.cm_content" descriptionId="search.form.desc.cm_content">cm:content</form>
            <form labelId="search.form.label.cm_folder" descriptionId="search.form.desc.cm_folder">cm:folder</form>
       [b]<form labelId="Search By Size" descriptionId="Search by size">cm:content</form>[/b] <!– Mine –>
         </forms>
      </advanced-search>
   </config>

<config evaluator="model-type" condition="cm:content">
  <forms>
   <form id="search">
    <field-visibility>
       <!– <show id="kb:ilLevelOne" /> –>
       <show id="mimetype" />
       <show id="cm:categories" force="true"/> 
       <show id="size" />
    </field-visibility>
    <appearance>
       <field id="mimetype" label="Document Type">
           <control template="/org/alfresco/components/form/controls/mimetype.ftl" />
       </field>
       <field id="cm:categories" label="Document Category">
          <control>
               <control-param name="compactMode">true</control-param>
           </control>
      </field>         
       <field id="size" label="Document Size">
          <control template="/org/alfresco/components/form/controls/numberrange.ftl" />    
       </field>
    </appearance>
   </form>
  </forms>
</config>


The size box has been shown but when size given it returns zero result and if I leave the size empty then it works properly.

My query log when I search using the size parameters is
(TYPE:"cm:content" AND (cm:content.size-range:"0|500003") AND (television )) AND -TYPE:"cm:thumbnail"

Caused by: NoViableAltException(45@[455:1: ftsTest : ( ( ftsFieldGroupProximity )=> ftsFieldGroupProximity -> ^( PROXIMITY ftsFieldGroupProximity ) | ftsTerm ( ( fuzzy )=> fuzzy )? -> ^( TERM ftsTerm (
fuzzy )? ) | ftsExactTerm ( ( fuzzy )=> fuzzy )? -> ^( EXACT_TERM ftsExactTerm ( fuzzy )? ) | ftsPhrase ( ( slop )=> slop )? -> ^( PHRASE ftsPhrase ( slop )? ) | ftsExactPhrase ( ( slop )=> slop )? ->
^( EXACT_PHRASE ftsExactPhrase ( slop )? ) | ftsTokenisedPhrase ( ( slop )=> slop )? -> ^( PHRASE ftsTokenisedPhrase ( slop )? ) | ftsSynonym ( ( fuzzy )=> fuzzy )? -> ^( SYNONYM ftsSynonym ( fuzzy )?
) | ftsRange -> ^( RANGE ftsRange ) | ftsFieldGroup -> ftsFieldGroup | LPAREN ftsDisjunction RPAREN -> ftsDisjunction | template -> template );])


Please help  Smiley Happy
Thanking you!
2 REPLIES 2

mitpatoliya
Star Collaborator
Star Collaborator
Hi sanket,

Try this with this one in appearance section.
replace your field with this one.

<field id="size">
                  <control template="/org/alfresco/components/form/controls/size.ftl" />
  </field>

Hope this works.

mcasanket
Champ on-the-rise
Champ on-the-rise
Hi Mital,
    When I put the size.ftl instead of number.ftl it doesn't display the text boxes. Instead it displays none.
<field id="size">
                  <control template="/org/alfresco/components/form/controls/size.ftl" />
  </field>



Thanking you!