cancel
Showing results for 
Search instead for 
Did you mean: 

dot and dash in Lucene queries

pcuvecle
Champ in-the-making
Champ in-the-making
Hi all,

I have created a cm:content with  :
name : 08.DP.01 MNJ.pdf
title : 08-DP-01 MNJ

and I face some strange behaviors when trying to search for my document
Here are the tests I did from the webclient :
In quick search (supposed to combine a TEXT + cm:name search)
08.DP >> no results
08\.DP >> document found
08.DP* >> document found
08.DP.01 >> document found
08 >> document found

Is there a special meaning in searching for a sentence with a single "dot" in it ? Do one need to espace the dot ?

Now from the advanced search : search on cm:title only
08-DP-01 MNJ >> not found
because translated into this lucene query :+@\{http\://www.alfresco.org/model/content/1.0\}title:'08\-DP\-01 MNJ"   The problem is that the query builder considers that it is a sentence because of the space after 01 but still escapes automaticaly the dashes. When running the same lucene query without the backslash (+@\{http\://www.alfresco.org/model/content/1.0\}title:'08-DP-01 MNJ" )
the document is found, but unfortuanately it is not what is done from the advanced search

other test :
08-DP-01 >> document found because there is no space, so it is translated  witout double quotes: +@\{http\://www.alfresco.org/model/content/1.0\}title:08\-DP\-01

So how can I search for a complete title such as "08-DP-01 MNJ" ?

Thanks in advance for you help  Smiley Happy
1 REPLY 1

kevinr
Star Contributor
Star Contributor
Now from the advanced search : search on cm:title only
08-DP-01 MNJ >> not found
because translated into this lucene query :+@\{http\://www.alfresco.org/model/content/1.0\}title:'08\-DP\-01 MNJ"   The problem is that the query builder considers that it is a sentence because of the space after 01 but still escapes automaticaly the dashes. When running the same lucene query without the backslash (+@\{http\://www.alfresco.org/model/content/1.0\}title:'08-DP-01 MNJ" )
the document is found, but unfortuanately it is not what is done from the advanced search

That sounds like a bug - or at least something that should be configurable. I suspect if the search is a phrase search "in quotes" then the search code should not escape the value - which means it would then work.

I have raised an issue for it:
http://issues.alfresco.com/browse/AWC-1743

Thanks,