cancel
Showing results for 
Search instead for 
Did you mean: 

Lucene and Custom Model

vbeyer
Champ in-the-making
Champ in-the-making
Hello,

I have a strange problem with a lucene query on my alfresco.
In my custom model I have some extra Propertys added to the content model:

<?xml version="1.0" encoding="UTF-8"?>
<model name="dms:contentmodell" xmlns="http://www.alfresco.org/model/dictionary/1.0">
   <description>Content Modell SMV Toolsystem DMS</description>
   <author>bev</author>
   <version>1.0</version>

   <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"/>
    </imports>

   <namespaces>
      <!– Define a Namespace for my new definitions –>
      <namespace uri="de.esg.wsw.smv.toolsystem.dms.content" prefix="dms"/>
   </namespaces>
   
   <!– Type and Aspect definitions go here –>
   <types>
      <type name="dms:content">
         <title>Toolsystem DMS Content</title>
         <parent>cm:content</parent>
         <properties>
            <property name="dms:docname">
               <type>d:text</type>
               <index enabled="true">
               <atomic>true</atomic>
               <stored>true</stored>
               <tokenised>both</tokenised>
               </index>
            </property>
            <property name="dms:filename">
               <type>d:text</type>
               <index enabled="true">
               <atomic>true</atomic>
               <stored>true</stored>
               <tokenised>both</tokenised>
               </index>
            </property>
            <property name="dms:standort">
               <type>d:text</type>
               <index enabled="true">
               <atomic>true</atomic>
               <stored>true</stored>
               <tokenised>both</tokenised>
               </index>
            </property>
            <property name="dms:dienst">
               <type>d:text</type>
               <index enabled="true">
               <atomic>true</atomic>
               <stored>true</stored>
               <tokenised>both</tokenised>
               </index>
            </property>
            <property name="dms:komponente">
               <type>d:text</type>
               <index enabled="true">
               <atomic>true</atomic>
               <stored>true</stored>
               <tokenised>both</tokenised>
               </index>
            </property>
            <property name="dms:komponenten-id">
               <type>d:text</type>
               <index enabled="true">
               <atomic>true</atomic>
               <stored>true</stored>
               <tokenised>both</tokenised>
               </index>
            </property>
            <property name="dms:beschreibung">
               <type>d:text</type>
               <index enabled="true">
               <atomic>true</atomic>
               <stored>true</stored>
               <tokenised>both</tokenised>
               </index>
            </property>
            <property name="dms:status">
               <type>d:text</type>
               <index enabled="true">
               <atomic>true</atomic>
               <stored>true</stored>
               <tokenised>both</tokenised>
               </index>
            </property>
         </properties>
      </type>
    </types>


</model>

I've some Nodes with data in it. The Property "beschreibung" has following values:
"Das ist ein Test"
"Das ist noch ein Test"
"DDD"

Now is use the following Query:
queryString +="+@dms\\:beschreibung:\"" + searchContent.getBeschreibung()+"\" ";
Query rQuery = new Query(Constants.QUERY_LANG_LUCENE, queryString);

If i do the query with : +@dms\:beschreibung:"D*"
Only DDD is found, but I would expect  all tree.
If I do search with:  +@dms\:beschreibung:"*test*"
I'll find the first two, as expected, but if I'll try: +@dms\:beschreibung:"*ist*"
No one is found, but I would expect same as above.

So, what ist my Problem? Ist the Query wrong? Is it a feature I dont understand? Is my Custom Model rubbish?
Please help!
1 REPLY 1

andy
Champ on-the-rise
Champ on-the-rise
Hi

You are doing tokenised quoted wildcards (which will do the best it can with stemming)
It looks like you are searching for a stop word - so it generates no tokens - so no results
Put = before the query term avoid tokenisation.

Andy