AnsweredAssumed Answered

Lucene search sort troubles

Question asked by lista on Jul 19, 2010
Latest reply on Jul 19, 2010 by lista
I'm having troubles understanding how the sort works.
When I take a look at the script below, I expect to get a result-set ordered by title. However, this is not the case, and instead I get the result-set that can also be found below.

Any ideas why this happens?

var logFile = userhome.childByNamePath("test.txt");

if (logFile == null) {
   var logFile = userhome.createNode("test.txt", "cm:content");
}

var sortby = "@" + "cm:title";
var query = "PATH:\"" + "/app:company_home/cm:test" + "//*\"";
query += " AND " + "ASPECT:\"" + "cm:folder" + "\"";

var results = search.luceneSearch(query, sortby, false);
   
for each (result in results) {
   logFile.content += result.properties["cm:title"] + "\n";
}

vtest3 vtest3_1273647023066.tiff
UP1_Ulazna
UP1_Izlazna_1
UP1_6
UP1_5
UP1_4
test9
test8
test7
test66
test6
test55
test5
test4
test3
test22
test2
test10
test
test
test
racun
NEUPasdasd
asdhasdhdlhkasdhl
asdadasd
333333
222222
21e12e2sdss
test
tes1111111
test123123
test2
test3
test1
test2
test3
test4
test5
test6
test19
test13
test8
1414
1515
1616
1717

Outcomes