cancel
Showing results for 
Search instead for 
Did you mean: 

Lucene problems with special characters like - _ @ $

soriaedu79
Champ in-the-making
Champ in-the-making
Hello

I have a space with 2 files:

file1.txt
file1-1.txt

I obtain the following results for this querys from the Alfresco explorer:

Query 1
file1-*
Result
file1.txt
Expected
file1-1.txt

Query 2
file1_*
Result
file1.txt
Expected
0 docs

Query 3
file1_
Result
file1.txt
Expected
0 docs
There is a problem with the special characters and I don't know how to fix it. I'm using Alfresco 3.3.

Making the query from a web service I obtain the same results.

I searched the lucene index properties in the repository.properties but I didn't find anything.

Any clue?
11 REPLIES 11

abhashree
Champ in-the-making
Champ in-the-making
hi
Actually i did nt get your question properly.May be i wrong what i understand your questions is you have created two files file1.txt and file-1.txt.But you searched the query by giving "_" in place of "-" as you have given in the name .so it didnt show any results.

soriaedu79
Champ in-the-making
Champ in-the-making
Hello,

No, if you read my queries:

file1-*  -> It shows only file1.txt and it should show ONLY file1-1.txt

file1_* -> It shows file1.txt but it should display no files because there are no files starting with the sequence "file1_". I wrote that to show the problem of Lucene with the special characters.

Anyway, thank you for your interest.

By the way, it's the 10th Alfresco post I wrote and as far as now the Alfresco engineers or partners never say anything. I am not lucky with that. I'll keep trying…

abhashree
Champ in-the-making
Champ in-the-making
Hi
now i get the question and also trying to find out the solution.Dont be disheartened.

abhashree
Champ in-the-making
Champ in-the-making
hi
i  tried by taking the same example.U r right..but i also tried others with Special char it is taking..i m giving the example
i have created two text files named as file1-1@2$.txt and file1-@2$#.txt and when i searched by the query file1-* it showed the second1.
So i think there is no problem with special characters but the previous example may have some exceptions…
I am thinking about the problem..

abhashree
Champ in-the-making
Champ in-the-making
hi
i think it may happen when we are searching by giving file1-* it searches the file which has the name like file1-and started with any special char not with a number or any char except some special char .so when u searched file1-* it showed only file1.txt.
May be it is the search criteria of lucene…

soriaedu79
Champ in-the-making
Champ in-the-making
I'm sorry but I dind't understand your last post. Could you show me an example?

Anyway the search file1-* should always shows no results because there are no files starting with file1-

Thank you

abhashree
Champ in-the-making
Champ in-the-making
hi
do u understand my first post?
suppose create  files named as file1-@32#.txt ,file1-1@#.txt and file1-a$.txt then search by the query file1-* then u will get the result file1-@32#.txt.
u wont get others files as they have letter(1) and char(a) after special char(-).i think this will clarify ur doubts…
There are some rules for naming standard and search standard in alfresco…

soriaedu79
Champ in-the-making
Champ in-the-making
OK, do you know where can I read these rules for naming standard in Alfresco?

I will do the question in a different way.

I have the files

file1.txt
file1-2.txt
file1-3.txt
file1-4.txt

Is there any lucene query in Alfresco to recover the files file1-2.txt, file1-3.txt, file1-4.txt ?????

I thougt that file1-* would do that job but actually it didn't.

Thank you

abhashree
Champ in-the-making
Champ in-the-making
hi
i am giving u the path where u can find the files about lucene engine..Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/org/apache/lucene/store
i am not sure..
and about ur question i think there is no query for searching all the files…
what i realise  after" -" if u give some number like 2,3,4 and give the query file1-* then it willnt show all the files…