cancel
Showing results for 
Search instead for 
Did you mean: 

Advanced Search on custom properties doesn't work

deny7
Champ on-the-rise
Champ on-the-rise

I'm running locally in Eclipse Alfresco AIO project. Share version is 5.2.f. Platform version is 5.2.g. SDK version 3.0.1.

 

I want to add custom advance search form which will search for my custom properties.

 

I did below steps but when I try to search for my custom property using my custom advanced search form it gives me ' 0 results ' every time.

 

I'm testing it like this:

1. I create random file in folder

2. then I change type of that file to 'ex:document', then I see my custom property field

3. I click on edit properties and I fill this field with some text.

4. Then I try to search for this property but it gives me 0 results.

I also checked solr.log, alfresco.log, share.log -- all without exception's.

 

Did I miss something? Is there any additional configuration needed? I'm assuming its problem with indexing in solr? Please can anybody help, I'm very new to Alfresco.

 

--------------------------------------------------------------------------------------------------------------------------------

I did these steps:

 

I created my custom model exampleContentModel.xml file in location alfresco/module/model/:

<types>

              <!-- Custom types for advanced search forms -->  

            <type name="ex:casesSearch">

                    <parent>ex:document</parent>

            </type>

 

<type name="ex:document">

            <parent>cm:content</parent>

            <properties>

                <property name="ex:clientName">

                    <type>d:text</type>

             </property>

</type>

</types>

Then I edited my share-config-custom.xml file where I added advanced search forms in location src/main/resources/META-INF/:

<config evaluator="node-type" condition="ex:document">

<forms>

<!-- Default form configuration for the cm:content type -->

<form>

<field-visibility>

<show id="cm:name" />

<show id="cm:title" force="true" />

<show id="cm:description" force="true" />

<show id="ex:clientName" force="true" />

</field-visibility>

<appearance>

 

<set id="docSet" appearance="bordered-panel"

label-id="form.set.label.document" />

<field id="ex:clientName" label-id="form.field.label.hypo.klantnaam" set="docSet" />

 

</appearance>

 

</form>

</config>

 

<!-- __________________________________ advance search form declaration _________________________________________________ -->

<config evaluator="model-type" condition="ex:casesSearch">

<forms>

<form id="search">

<field-visibility>

<show id="ex:clientName" />

</field-visibility>

</form>

</forms>

</config>

 

<!-- __________________________________ Advanced search form's configuration _________________________________________________ -->

 

<config 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="Cases site"

descriptionId="search.form.desc.cm_folder">ex:casesSearch</form>

</forms>

</advanced-search>

</config>

 

2 REPLIES 2

sp2
Elite Collaborator
Elite Collaborator

Hi,

Please make property searchable.

Ex.

<property name="mcm:id">
      <type>d:text</type>
        <index enabled="true">
               <atomic>true</atomic>
                <stored>false</stored>
               <tokenised>false</tokenised>
          </index>
</property>

roberto_gamiz
Star Contributor
Star Contributor

You have defined a custom avanced form for type "ex:casesSearch" but  have created a content with the type "ex:document". 

The "ex:casesSearch" avanced search form is going to filter for this type and metadata and never is going to find a content of type "ex:document".

Notice too,  that in the search result page you have to select if the search is done for all ther repository or only in the sites.




 Roberto Gámiz Sánchez

Alfresco Content Services Engineer