I am having a problem using the search facilities in Openkm with version 1.1.1 of the sdk for c#.
First, here is my test code, adapted from the examples: https://docs.openkm.com/kcenter/view/sd ... yPaginated.
In the folder I wish to search, there are 4 documents with the text "ipad" in their names. If I use the browser UI, check "use advanced mode", put "ipad" in the name box, and the full folder path in the Advanced->Folder box and click search then I get 4 results. All as expected.
However if I run the above code, I get this:
Also, the one result that is found has no data associated with it.
Any clue what is going on? Is search broken in sdk 1.1.1?
First, here is my test code, adapted from the examples: https://docs.openkm.com/kcenter/view/sd ... yPaginated.
Code: Select all
So what is the problem?using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;
namespace openkm_search_test
{
public class Program
{
static void Main(string[] args)
{
String host = "http://[my server ip]:8080/OpenKM";
String username = "okmAdmin";
String password = "admin";
OKMWebservice ws = OKMWebservicesFactory.newInstance(host, username, password);
try
{
QueryParams qParams = new QueryParams();
qParams.domain = QueryParams.DOCUMENT;
qParams.name = "ipad";
qParams.folder = "[uuid of folder I wish to search]";
ResultSet rs = ws.findPaginated(qParams, 0, 10);
System.Console.WriteLine("Total results:" + rs.total);
foreach (QueryResult qr in rs.results)
{
System.Console.WriteLine(qr);
}
Console.WriteLine("Press Enter to terminate...");
Console.Read();
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
}
In the folder I wish to search, there are 4 documents with the text "ipad" in their names. If I use the browser UI, check "use advanced mode", put "ipad" in the name box, and the full folder path in the Advanced->Folder box and click search then I get 4 results. All as expected.
However if I run the above code, I get this:
Code: Select all
It is searching the whole repository, not just the folder uuid I fed it, and finding 28 results. The weird thing is that the rs.count = 1, but rs.results=28. I was expecting rs.count to be 10.Total results:28
com.openkm.sdk4csharp.bean.QueryResult
Press Enter to terminate...
Also, the one result that is found has no data associated with it.
Any clue what is going on? Is search broken in sdk 1.1.1?