AnsweredAssumed Answered

Error getting constraint values from lucene search

Question asked by cperez on Sep 5, 2014
Latest reply on Sep 10, 2014 by cperez
Hi all.

I'm using a lucene search query to find documents(pdf files) with some specific properties (Including the dropdown constraints).
I get the documents but when I try to find documents with some specific constraint( like "Dog type") this propertie is not searched but the rest of the query is searched. I also change the " " (white space) with "_x0020_" explained in http://wiki.alfresco.com/wiki/Search#Finding_nodes_by_QName but I have the same result (propertie not searched).

This is the lucene search that doesn't work with the constraint:

@dig\:Type:"Dog type" @\{http\://www.alfresco.org/model/content/1.0\}content.mimetype:application/pdf + @dig\:CIF:B70099973 + @dig\:Date_in:[2014\-01\-01T00:00:00 TO 2014-09-05T00:00:00]



And this is my model:

   <constraints>
      <constraint name="dig:listType" type="LIST">
         <parameter name="allowedValues">
            <list>
               <value>Dog type</value>
               <value>Cat type</value>
               …
               <value>Horse type</value>
               <value>Other type</value>
            </list>
         </parameter>
         <!– <parameter name="caseSensitive">
            <value>true</value>
         </parameter> –>
      </constraint>
      <constraint name="dig:listSubtype" type="LIST">
         <parameter name="allowedValues">
            <list>
               <value>New</value>
               <value>Change</value>
               <value>Remove</value>
               <value>Other</value>
            </list>
         </parameter>
         <!– <parameter name="caseSensitive">
            <value>true</value>
         </parameter> –>
      </constraint>
   </constraints>

   <types>
      <type name="dig:Doc_Animal">
         <title>Animals Document</title>
         <parent>cm:content</parent>
         <properties>
            <property name="dig:Name">
               <title>Name</title>
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>
            <property name="dig:CIF">
                <title>CIF Client</title>
                <type>d:text</type>
                <mandatory>true</mandatory>
            </property>
            <property name="dig:Date_in">
               <title>IncommingDate</title>
               <type>d:date</type>
               <mandatory>true</mandatory>
            </property>
            <property name="dig:Type">
               <title>Document Type</title>
               <type>d:text</type>
               <mandatory>true</mandatory>
               <constraints>
                  <constraint ref="dig:listType"/>
               </constraints>
            </property>
            <property name="dig:Subtype">
               <title>Document Subtype</title>
               <type>d:text</type>
               <mandatory>false</mandatory>
               <constraints>
                  <constraint ref="dig:listSubtype"/>
               </constraints>
            </property>
            <property name="dig:Num">
               <title>Document Number</title>
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
            <property name="dig:Description">
               <title>Description</title>
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
         </properties>
      </type>
   </types>


Anyone know how I fix this?

Outcomes