Lucene search exact property value is not getting

cancel
Showing results for 
Search instead for 
Did you mean: 
kranthi
Active Member II

Lucene search exact property value is not getting

In my data-List I configured multiple groups in properties

         

  •       IT
  •       IT1
  •       IT2

when I try to search the exact group with property like IT.Still it is showing all the 3 properties

I tried like this:

PATH:"//app:company_home/st:sites/cm:test//*" AND TYPE:"tst:departmentList"  =@tst\:deptName:"IT"

PATH:"//app:company_home/st:sites/cm:test//*" AND TYPE:"tst:departmentList"  @tst\:deptName:"IT"

In both cases I got the all 3 values.

6 Replies
afaust
Master

Re: Lucene search exact property value is not getting

Because you have not used an AND before the last condition, you are basically doing an OR query here (unless you have the default operator set to AND).

kranthi
Active Member II

Re: Lucene search exact property value is not getting

Now I tried like that but there is no luck 

PATH:"//app:company_home/st:sites/cm:test//*" AND TYPE:"tst:departmentList"  AND =@tst\:deptName:"IT"

 

found 0 results for above query.

PATH:"//app:company_home/st:sites/cm:test//*" AND TYPE:"tst:departmentList"  AND @tst\:deptName:"IT"

 

In this case it shows all values starting with IT in that List Result I got for above query is : found 3 results... 

But we need to get only one values from there.

 

andy1
Senior Member

Re: Lucene search exact property value is not getting

Hi

You need to make sure your property is set to support identifier based queries. How is this property defined? You need it to be tokenised "both" or "false" ....... not set to "true".

Andy

kranthi
Active Member II

Re: Lucene search exact property value is not getting

I set this property inside the datalist.

I didn't get what your saying for this :You need to make sure your property is set to support identifier based queries

Please can you elaborate it. 

andy1
Senior Member

Re: Lucene search exact property value is not getting

Hi


Please post your property definition so we can tell what you have done and suggest the fix.

Andy

kranthi
Active Member II

Re: Lucene search exact property value is not getting

Hi Andy,

Please find 

<type name="tst:departmentList">
      <title>Department Groups List</title>
      <description>Department and it's groups</description>
      <parent>dl:dataListItem</parent>

<properties>
      <property name="tst:deptName">
            <title>Department Name</title>
             <type>d:text</type>
              <mandatory>true</mandatory>
      </property>
</properties>
<associations>
      <association name="tst:deptGroup" read-only="false">
               <title>Department Group</title>
               <source>
                     <mandatory>false</mandatory>
                     <many>true</many>
               </source>
            <target>
                    <class>cm:authorityContainer</class>
                     <mandatory>true</mandatory>
                     <many>false</many>
            </target>
</association>

</type>