• Searching using Openkm 6.3.1, sdk4csharp 1.1.1

  • We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #42183  by ofstab
 
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.
Code: Select all
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());
            }
        }
    }
}
So what is the problem?

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
Total results:28
com.openkm.sdk4csharp.bean.QueryResult
Press Enter to terminate...
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.

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?
 #42187  by jllort
 
Here some suggestion:
Code: Select all
Params.name = "ipad*"; // put here the * ( wildcard )
qParams.path = "use  the path"; // should not be qParams.folder should be qParams.path ( confirm this point because here could be some bug )./code]
 #42210  by ofstab
 
I am happy to take a glance at the code if that would help. Don't think this is online?
I have another problem with an empty stream being returned from getcontent which may also have an answer in the code.

Thanks.

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.