cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with searching for document title

dbackhausen
Champ in-the-making
Champ in-the-making
Hi,

I face a new problem when searching the document repository via the web service layer. Supposed I have a document called this is a document draft.doc and I trigger the following search:

@cm\:content.mimetype:"application/msword" AND @cm\:title:"this is a document"

The result is shown as expected. But when I trigger the following query, I don't get any result:

@cm\:content.mimetype:"application/msword" AND @cm\:title:"this is a document draft"

There is something wrong about the word draft. Some idea? Thanks!

Cheers,
Daniel
6 REPLIES 6

tremalnaik
Champ in-the-making
Champ in-the-making
Has you triyng this query?

@cm\:content.mimetype:"application/msword" AND @cm\:title:"this is a document draft.doc"

openpj
Elite Collaborator
Elite Collaborator
Probably you have to try the following:
@cm\:content.mimetype:"application/msword" AND @cm\:name:"this is a document draft.doc"
Hope this helps.

dbackhausen
Champ in-the-making
Champ in-the-making
Hi!

Thank you for your replies! If I enter the following query (exact phrase):

@cm\:content.mimetype:"application/msword" AND (@cm\:title:"this is a document draft.doc" OR @cm\:name:"this is a document draft.doc")

the document is found. If I enter the following query (exact phrase):

@cm\:content.mimetype:"application/msword" AND (@cm\:title:"this is a document draft*" OR @cm\:name:"this is a document draft*")

the document is also found. But if I change the query (exact phrase) to:

@cm\:content.mimetype:"application/msword" AND (@cm\:title:"this is a document draft" OR @cm\:name:"this is a document draft")

the document is not found. In general I would have expected, that the second query (without the document ending) also returns the desired document.

If I enter the following query (all words):

@\{http\://www.alfresco.org/model/content/1.0\}content.mimetype:* AND ((@cm\:title:this AND @cm\:title:is AND @cm\:title:a AND @cm\:title:document AND @cm\:title:draft) OR (@cm\:name:this AND @cm\:name:is AND @cm\:name:a AND @cm\:name:document AND @cm\:name:draft)
the document is also not found.

What am I missing? Wrong query Any idea?

Cheers,
Daniel

dbackhausen
Champ in-the-making
Champ in-the-making
Hm, I think I already know the answer: The word draft is not taken for it's own. Lucene only sees the word draft.doc as separate word.

openpj
Elite Collaborator
Elite Collaborator
Notice that by default the cm:title property is a multi language property (mltext), taking a look at the contentModel.xml we have:

<property name="cm:title">
    <title>Title</title>
    <type>d:mltext</type>
    <index enabled="true">
        <atomic>true</atomic>
        <stored>false</stored>
        <tokenised>both</tokenised>
    </index>
</property>
This means that the property could be indexed with a specific value for each locale, if your client applications access to Alfresco with different locale settings.
Lucene will store the value in different index sections, if you have different locale settings for client applications, you could have different results for searches.

I suggest to check if your content is correctly indexed checking the cm:content property for the content in the Node Browser. Here you can check the locale setting for the content that is used by Lucene to categorize the index section.

Hope this helps.

dbackhausen
Champ in-the-making
Champ in-the-making
Hi OpenPj,

it is not a language problem but more a problem of our store operations. We are setting the title equal to the file name. So this problem only occures, when the searched keyword is at the end of the name (before the extension). We have to modify this. But thank's anyway for your hint!

Cheers,
Daniel