cancel
Showing results for 
Search instead for 
Did you mean: 

Lucene and empty spaces.

monitloth
Champ on-the-rise
Champ on-the-rise
Hello,

I have a query which searchs a full directory. A input defines which directory will be searched. But when using a value with an empty space ("Sony Project"), I get no results. The query works otherwise without any problem.

My query that works:
TYPE:"{http://www.alfresco.org/model/content/1.0}content" +PATH:"/app:company_home/cm:Rentals/cm:Movies/cm:Action//*" -TYPE:"{http://www.alfresco.org/model/content/1.0}folder" +@cm\:name:"*a*"

No results, no warning/error:
TYPE:"{http://www.alfresco.org/model/content/1.0}content" +PATH:"/app:company_home/cm:Rentals/cm:Movies/cm:Other Genres//*" -TYPE:"{http://www.alfresco.org/model/content/1.0}folder" +@cm\:name:"*a*"

Thanks for your support.
10 REPLIES 10

mikeh
Star Contributor
Star Contributor
You need to encode the space character: http://wiki.alfresco.com/wiki/Search#Finding_nodes_by_QName

Mike

monitloth
Champ on-the-rise
Champ on-the-rise
Great, it works now!

monitloth
Champ on-the-rise
Champ on-the-rise
Ok, an other question about whitespaces/

I have the following:
TYPE:"{http://www.alfresco.org/model/content/1.0}folder" 
+PATH:"/app:company_home/cm:Cars/*/*"+@cm\:name:"*Class_x0020_A*"
+(PARENT:"workspace://SpacesStore/bbe63ba8-8e62-4708-bfc5-cea3c94cb021")
It does give no result. When I give "Class" it gives the result, which is "Class A". This also gives nothing: "*ass_x0020_*".

And what about custom properties? I have ship_name and make the following
+@cm\:erpnumber:"TITANIC"
which should give a result, but nothing. In Advanced Search I added it as custom property and I got the result. I must say that it is an aspect property and not embedded in the model (which is folder) itself (so not a model that inherits from folder).

Thanks.

ericj
Champ in-the-making
Champ in-the-making
Hi,
could you tell me if you have solved this problem ?
And how ?
Thanks

lista
Star Contributor
Star Contributor
Escaping the white character is not necessary at all when in cm:name part, if I'm not mistaken.

rogier_oudshoor
Champ in-the-making
Champ in-the-making
Actually, you only need to escape white-spacing in PATH queries to lucene. All others (TYPE, TEXT, @cm:this_att) do not need escaping.

icemaker
Champ in-the-making
Champ in-the-making
I also have this problem with white spaces.
I want to search all nodes having the property 'cor:JobState' equal to 'Approve By A'.

If I enter :

@cor\:JobState:"Approved By A" -> no result

@cor\:JobState:"Approved" -> nodes having the property equal to 'Approve By A' are correctly returned. But nodes having the property equals to 'Approve by B' are also returned. So this is not a solution

Encoding the space character does not work:
@cor\:JobState:"Approved_x0020_By_x0020_A" -> no result.

Any idea?

damiar
Champ in-the-making
Champ in-the-making
Did you try with the node browser?

icemaker
Champ in-the-making
Champ in-the-making
Did you try with the node browser?

Yes I tested through the JAVA API and the node browser.