cancel
Showing results for 
Search instead for 
Did you mean: 

Error getting constraint values from lucene search

cperez
Champ in-the-making
Champ in-the-making
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?
2 REPLIES 2

mitpatoliya
Star Collaborator
Star Collaborator
First try this query.

@dig\:Type:"Dog type" AND @cm\:mimetype:"application/pdf" AND @dig\:CIF:"B70099973"

Then you need to ractify your Date Query part.
To get idea on date search check out this post
https://docs.alfresco.com/rm2.1/tasks/rm-search-daterange.html

cperez
Champ in-the-making
Champ in-the-making
Thanks for your help!!

I forgot the "+" between the two clauses. I use "+" instead of "AND" and now all works fine.
And my date query its OK.

Thanks a lot.