cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to get results in a customized share search

horrikhalid
Champ in-the-making
Champ in-the-making
Hi,
I create a custom model like this :

<types>
  
      <!– Definition of new Content Type: Standard Operating Procedure –>
      <type name="ef:document">
         <title>EF Document Procedure</title>
         <parent>cm:content</parent>
         <properties>
            <property name="ef:invoiceDate">
            <title>Date du facturation</title>
               <type>d:text</type>
            <index enabled="true">
               <atomic>false</atomic>
               <stored>true</stored>
               <tokenised>false</tokenised>
            </index>
            </property>
            <property name="ef:invoiceNumber">
            <title>Facture n°</title>
               <type>d:text</type>
            <index enabled="true">
               <atomic>false</atomic>
               <stored>true</stored>
               <tokenised>false</tokenised>
            </index>
            </property>
         <property name="ef:total">
            <title>Total</title>
               <type>d:text</type>
            </property>
            <property name="ef:customer">
            <title>Client</title>
               <type>d:text</type>
             <index enabled="true">
               <atomic>false</atomic>
               <stored>true</stored>
               <tokenised>false</tokenised>
            </index>
            </property>
           
       </properties>
      </type>
     
    </types>


I make some configuration in the share-config-custom.xml to get the Advanced Search Form

<alfresco-config>
  
   <!– Repository Library config section –>
   <config evaluator="string-compare" condition="RepositoryLibrary" replace="true">
      <!–
         Whether the link to the Repository Library appears in the header component or not.
      –>
      <visible>true</visible>
   </config>

   <config evaluator="string-compare" condition="Remote">
      <remote>
         <endpoint>
            <id>alfresco-noauth</id>
            <name>Alfresco - unauthenticated access</name>
            <description>Access to Alfresco Repository WebScripts that do not require authentication</description>
            <connector-id>alfresco</connector-id>
            <endpoint-url>http://localhost:8888/alfresco/s</endpoint-url>
            <identity>none</identity>
         </endpoint>

         <endpoint>
            <id>alfresco</id>
            <name>Alfresco - user access</name>
            <description>Access to Alfresco Repository WebScripts that require user authentication</description>
            <connector-id>alfresco</connector-id>
            <endpoint-url>http://localhost:8888/alfresco/s</endpoint-url>
            <identity>user</identity>
         </endpoint>

         <endpoint>
            <id>alfresco-feed</id>
            <name>Alfresco Feed</name>
            <description>Alfresco Feed - supports basic HTTP authentication via the EndPointProxyServlet</description>
            <connector-id>http</connector-id>
            <endpoint-url>http://localhost:8888/alfresco/s</endpoint-url>
            <basic-auth>true</basic-auth>
            <identity>user</identity>
         </endpoint>
      </remote>
   </config>
  
   <!– Document Library config section –>
   <config evaluator="string-compare" condition="DocumentLibrary">
      <aspects>
         <!– Aspects that a user can see –>
         <visible>
            <aspect name="cm:generalclassifiable" />
            <aspect name="cm:complianceable" />
            <aspect name="cm:dublincore" />
            <aspect name="cm:effectivity" />
            <aspect name="cm:summarizable" />
            <aspect name="cm:versionable" />
            <aspect name="cm:templatable" />
            <aspect name="cm:emailed" />
            <aspect name="emailserver:aliasable" />
            <aspect name="cm:taggable" />
            <aspect name="app:inlineeditable" />
            <aspect name="gd:googleEditable" />
            <aspect name="cm:geographic" />
            <aspect name="exif:exif" />
         </visible>
         <!– Aspects that a user can add. Same as "visible" if left empty –>
         <addable>
         </addable>
         <!– Aspects that a user can remove. Same as "visible" if left empty
         –>
         <removeable>
         </removeable>
      </aspects>
      <types>
         <type name="cm:content">
            <subtype name="ef:document"/>
         </type>
      </types>   
   </config>
   
   <config replace="true" evaluator="string-compare" condition="AdvancedSearch">
      <advanced-search>
         <!– Forms for the advanced search type list –>
         <forms>
            <!–
               The 'form' config element contains the name of the model type
               of the form to display.
              
               The element supports the following optional attributes:
                  id = form id, the id of "search" will be assumed if not set
                  label = label text to display - defaults to model type if not set
                  labelId = I18N message id of label text to display
                  description = description text to display
                  descriptionId = I18N message id of description text to display
            –>
            <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>
         <form labelId="search.form.label.ef.invoice" descriptionId="search.form.desc.ef.invoice">ef:document</form>
         </forms>
      </advanced-search>
   </config>
 
    <config evaluator="model-type" condition="ef:document">
   <forms>
      <!– Search form –>
         <form id="search">
            <field-visibility>
               <show id="cm:name" />
               <show id="cm:title" force="true" />
               <show id="cm:description" force="true" />
               <show id="mimetype" />
            <show id="ef:invoiceNumber" force="true"/>
            <show id="ef:customer" force="true"/>
            </field-visibility>
            <appearance>
               <field id="mimetype">
                  <control template="/org/alfresco/components/form/controls/mimetype.ftl" />
               </field>
            <field id="ef:invoiceNumber" />
            <field id="ef:customer" />
            </appearance>
         </form>
      </forms>
   </config>
</alfresco-config>


When I make the full value in invoiceNumber or customer fields I get the correct document, Now my question :
1- How can I use  keywords like share quick search to find document where invoiceNumber contains the word "123" or find document that contains "Test" in custmer metadata.

I use alfresco 3.4d CE

Any help is apprciated
3 REPLIES 3

horrikhalid
Champ in-the-making
Champ in-the-making
I make this modification in the search.lib.js:

const QUERY_TEMPLATES = [
   {field: "keywords", template: "%(cm:name cm:title cm:description ef:invoiceNumber ef:customer ia:whatEvent ia:descriptionEvent lnk:title lnk:description TEXT)"}];


but w/out any success.

horrikhalid
Champ in-the-making
Champ in-the-making
I test with some lucene queries in the Alfresco node browser, for example if I type :
@ef\:customer:"*test*"
      
Or
 
@ef\:invoiceNumber:"*123*"

I get the result as expected

Did you try to include the asterisk in the search form as well?