cancel
Showing results for 
Search instead for 
Did you mean: 

Advance search guidance on my properties

bip1989
Star Contributor
Star Contributor

Following this tutorial: http://ecmarchitect.com/alfresco-developer-series-tutorials/content/tutorial/tutorial.html
I was able to make a custom content model working and i am able to see properties on share view details and edit properties.

Thank you for this great tutorial. It is very helpful.

I wanted my custom properties to search in advance search. I followed the above tutorial and configured advance search option and search form as explained.
I am able to see the properties on advance search page but when i provide the value and search, i get 0 results.

I don't see any errors in my development environment.

Also, one thing i noticed that- search is working for properties "scSmiley Tongueublished", "sc:isActive" etc.

I have added following properties in addition to what is given in tutorial.

<property name="scSmiley TongueublishedBy">
<type>d:text</type>
</property>
<property name="scSmiley TongueublishingComment">
<type>d:text</type>
</property>

The values which i have saved for these properties are, values are visible on view details page:
-------------------------------------------------
scSmiley TongueublishedBy = Bipin Dixit

scSmiley TongueublishingComment = Published this document
-------------------------------------------------

When i submit search from advance search screen by providing the values as mentioned above for the above given properties, i see 0 results.

Can you guide me, if i am missing anything ?

Here is my full content model:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Definition of new Model -->
<model name="sc:somecomodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

<!-- Optional meta-data about the model -->
<description>Someco Model</description>
<author>Jeff Potts</author>
<version>1.0</version>

<!-- Imports are required to allow references to definitions in other models -->
<imports>
<!-- Import Alfresco Dictionary Definitions -->
<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" />
<!-- Import Alfresco Content Domain Model Definitions -->
<import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />
<import uri="http://www.alfresco.org/model/system/1.0" prefix="sys"/>
</imports>

<!-- Introduction of new namespaces defined by this model -->
<namespaces>
<namespace uri="http://www.someco.com/model/content/1.0" prefix="sc" />
</namespaces>
<constraints>
<constraint name="sc:campaignList" type="LIST">
<parameter name="allowedValues">
<list>
<value>Application Syndication</value>
<value>Private Event Retailing</value>
<value>Social Shopping</value>
</list>
</parameter>
</constraint>
<constraint name="scSmiley SurprisedwnerList" type="LIST">
<parameter name="allowedValues">
<list>
<value>Smith</value>
<value>Jones</value>
<value>Jacobsen</value>
</list>
</parameter>
</constraint>
</constraints>

<types>
<!-- Enterprise-wide generic document type -->
<type name="sc:doc">
<title>Someco Document</title>
<parent>cm:content</parent>
<associations>
<association name="sc:relatedDocuments">
<title>Related Documents</title>
<source>
<mandatory>false</mandatory>
<many>true</many>
</source>
<target>
<class>sc:doc</class>
<mandatory>false</mandatory>
<many>true</many>
</target>
</association>
</associations>
<mandatory-aspects>
<aspect>cm:generalclassifiable</aspect>
</mandatory-aspects>
</type>

<type name="sc:whitepaper">
<title>Someco Whitepaper</title>
<parent>sc:doc</parent>
</type>

<type name="sc:marketingDoc">
<title>Someco Marketing Document</title>
<parent>sc:doc</parent>
<properties>
<property name="sc:campaign">
<type>d:text</type>
<mandatory>true</mandatory>
<multiple>true</multiple>
<constraints>
<constraint ref="sc:campaignList" />
</constraints>
</property>
<property name="sc:campaignOwner">
<type>d:text</type>
<mandatory>true</mandatory>
<multiple>false</multiple>
<constraints>
<constraint ref="scSmiley SurprisedwnerList" />
</constraints>
</property>
</properties>
</type>
<type name="sc:client">
<title>Someco Client</title>
<parent>sys:base</parent>
<properties>
<property name="sc:clientName">
<type>d:text</type>
</property>
<property name="sc:clientId">
<type>d:text</type>
</property>
</properties>
</type>
</types>

<aspects>
<aspect name="sc:webable">
<title>Someco Webable</title>
<properties>
<property name="scSmiley Tongueublished">
<type>d:date</type>
</property>
<property name="sc:isActive">
<type>d:boolean</type>
<default>false</default>
</property>
<property name="scSmiley TongueublishedBy">
<type>d:text</type>
</property>
<property name="scSmiley TongueublishingComment">
<type>d:text</type>
</property
</properties>
</aspect>

<aspect name="scSmiley TongueroductRelated">
<title>Someco Product Metadata</title>
<properties>
<property name="scSmiley Tongueroduct">
<type>d:text</type>
<mandatory>true</mandatory>
<multiple>true</multiple>
</property>
<property name="sc:version">
<type>d:text</type>
<mandatory>true</mandatory>
<multiple>true</multiple>
</property>
</properties>
</aspect>

<aspect name="sc:clientRelated">
<title>Someco Client Related</title>
<associations>
<association name="sc:relatedClients">
<title>Related Clients</title>
<source>
<mandatory>false</mandatory>
<many>true</many>
</source>
<target>
<class>sc:client</class>
<mandatory>false</mandatory>
<many>true</many>
</target>
</association>
</associations>
</aspect>
</aspects>
</model>


MyForm:

<!-- sc:whitepaper type (new nodes) -->
<config evaluator="model-type" condition="sc:whitepaper">
<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="cm:modified" />
<show id="cm:modifier" />
<!-- scSmiley TongueroductRelated -->
<show id="scSmiley Tongueroduct" />
<show id="sc:version" />
<!-- sc:webable -->
<show id="sc:isActive" />
<show id="scSmiley Tongueublished" />
<show id="scSmiley TongueublishedBy" />
<show id="scSmiley TongueublishingComment" />
</field-visibility>
<appearance>
<field id="mimetype">
<control template="/org/alfresco/components/form/controls/mimetype.ftl" />
</field>
<field id="cm:modifier">
<control>
<control-param name="forceEditable">true</control-param>
</control>
</field>
<field id="cm:modified">
<control template="/org/alfresco/components/form/controls/daterange.ftl" />
</field>
<!-- scSmiley TongueroductRelated -->
<field id="scSmiley Tongueroduct" label-id="prop.sc_product">
<control template="/org/alfresco/components/form/controls/textfield.ftl" />
</field>
<field id="sc:version" label-id="prop.sc_version">
<control template="/org/alfresco/components/form/controls/textfield.ftl" />
</field>
<!-- sc:webable -->
<field id="sc:isActive" label-id="prop.sc_isActive">
<control template="/org/alfresco/components/form/controls/checkbox.ftl" />
</field>
<field id="scSmiley Tongueublished" label-id="prop.sc_published">
<control template="/org/alfresco/components/form/controls/daterange.ftl" />
</field>

<field id="scSmiley TongueublishedBy" label-id="Published By">
<control template="/org/alfresco/components/form/controls/textfield.ftl" />
</field>
<field id="scSmiley TongueublishingComment" label-id="Publishing Comment">
<control template="/org/alfresco/components/form/controls/textfield.ftl" />
</field>
</appearance>
</form>
</forms>
</config>

2 ACCEPTED ANSWERS

jpotts
World-Class Innovator
World-Class Innovator

Thanks for reading the tutorial, I'm glad you found it helpful.

What you are doing should work. Maybe something is wrong with your SOLR server?

Have you tried going to the SOLR console, selecting the Alfresco core, then going to "Query" and running the search from there?

View answer in original post

abhinavmishra14
World-Class Innovator
World-Class Innovator

Enable these logs and see if you can find something:

log4j.logger.org.alfresco.repo.jscript.ScriptLogger=debug

log4j.logger.org.alfresco.solr.query.AbstractQParser=debug
log4j.logger.org.alfresco.repo.search.impl.solr.SolrQueryHTTPClient=debug

As Jeff suggested, check the SOLR console to see if you are able to search the properties or not.

~Abhinav
(ACSCE, AWS SAA, Azure Admin)

View answer in original post

4 REPLIES 4

jpotts
World-Class Innovator
World-Class Innovator

Thanks for reading the tutorial, I'm glad you found it helpful.

What you are doing should work. Maybe something is wrong with your SOLR server?

Have you tried going to the SOLR console, selecting the Alfresco core, then going to "Query" and running the search from there?

bip1989
Star Contributor
Star Contributor

Thank you Jeff, i checked solr and alfresco logs and I don't see any errors. Do i need to enable any special logging ? 

No i haven't check SOLR console, i will try that as well. 
Thanks again for guidance 

abhinavmishra14
World-Class Innovator
World-Class Innovator

Enable these logs and see if you can find something:

log4j.logger.org.alfresco.repo.jscript.ScriptLogger=debug

log4j.logger.org.alfresco.solr.query.AbstractQParser=debug
log4j.logger.org.alfresco.repo.search.impl.solr.SolrQueryHTTPClient=debug

As Jeff suggested, check the SOLR console to see if you are able to search the properties or not.

~Abhinav
(ACSCE, AWS SAA, Azure Admin)

bip1989
Star Contributor
Star Contributor

Thanks Jeff and Abhinav. My search is working now. After i added log config, I noticed solr call having value as : Published+this+document for scSmiley TongueublishedComment property. Same was the case for Author. When i manually changed the value to "Published this document" and executed on solr admin, it worked. 

I also followed some other posts on this forum where some folks had similar issues. I changed the index tokenization config to false and restarted my app. 

all good now