Knowledge Management Search As IR Search Replacement / Supplement

We've recently licensed the KM part of Service Manager for localized search of knowledge documents. I’d like to take advantage of the KB search to replace / supplement the IR search for Incident and Problem. The indexing and searching the “normal” text fields seems to be pretty straight forward. What I’d like to know is how one would add date/time searches, i.e. incident open time? I’m also wondering if all of the search terms are applied at the same time (I think yes) or if it’s like IR where the text search is done and then the discrete search terms are applied?

  • 1. To be sure you want to index the open.time field (and/or other similar fields)?

    2. Regarding the search query: the query is built and then submitted to the search engine. You can view the actual query being sent by uncommenting '//print("Submitted Query: " submitstring);' in the KMSearch ScriptLibrary record:

        • ScriptLibrary
        • KMSearch
        • Go to line 24 (or therabouts)
        • Uncomment: //print("Submitted Query: " submitstring);
        • When you submit a search it will be shown in the client Messages frame.



  • Brett,

    Correct - I really do want to index some of the more heavily searched discrete fields,, open.time, etc. I'm pretty sure that I just add them as fields in the Knowledge Base definition and re-index. I'm much more interested in knowing how one would pass/construct a query to the search engine. For example: open.time >= '01/01/16 01:00:00' and open.time <= '01/01/16 02:00)00'.

    I really haven't seen anything that points me in the right direction in the documentation.


  • I might be over simplifying this, but in the Advanced Search format the ability to search for indexed Incidents Opened Before and Opened After already exists. 

  • In the Advanced Search form of KM you can choose to isolate the search to Incidents. Using that as my example (in an oob 9.35 system) I did the following. Please let me know if I am on the same track:

    1. Knowledge Management > Search Knowledge > Advanced
    2. In the Query Field I entered: mail
    3. Scroll down to the the Incidents fielded search where there is Opened After and Opened Before
     - Opened After: 11/06/07 00:00:00
     - Opened Before: 11/15/07 00:00:00
    4. Search
    5. Query submitted to SOLR:

    Submitted Query: ((docbody:mail) OR (docbody_en:mail) OR (adlearn:mail) OR (adlearn_en:mail) OR (attachment:mail) OR (attachment_en:mail)) AND ((opentime: [* TO
    2007-11-15T07:00:00Z] AND opentime: [2007-11-6T07:00:00Z TO *] AND knowledgebase_name: Incident_Library ))

    6. Returns one result of 131 documents/incidents indexed.

  • Brett - Ah... I was using the Windows client and the way the advanced search format displays isn't the best. I needed to scroll down further to actually see the sub format.

    I am still not sure if I have a problem or not. When I do a straight up text search for "adxsm1 cozad", I get 15 records returned. In at least one of them the in the record is "adxsm1". The query for that is:

         KMSearch - Submitted Query: adxsm1 cozad

    When I do an advanced search and supply a value of adxsm1 for the with the same text search, I get 0 records returned.

       KMSearch - Submitted Query: ((docbody:adxsm1 cozad) OR (docbody_en:adxsm1 cozad) OR (adlearn:adxsm1 cozad) OR (adlearn_en:adxsm1 cozad) OR (attachment:adxsm1 cozad) OR (attachment_en:adxsm1 cozad)) AND (( (logicalname: "adxsm1" AND knowledgebase_name: Incident_Library)))

    The field is in the list of fields to index and is in the advance search JScript. 


    Any ideas?


  • Brett - I figured out how to directly search in SOLR. It's looking to me like the problem is that the part of the query is the issue. If I search directly for logicalname: "adxsm1" it returns 0 records. If I search for logicalname: adxsm1, it returns records. So it appears that the issue is that the search term is getting "quoted" when it shouldn't. Your thoughts?

  • When searching just on the what does the Search Query look like in the Messages? Structured something like this?

    Submitted Query: (logicalname: adxsm1 AND knowledgebase_name: Knowledge_Library)

  • Hi Brett - It looks like this:

          Submitted Query: ( (logicalname: "adxsm1" AND knowledgebase_name: Incident_Library))

    The issue is that the logicalname term is wrapped in double quotes. I have no idea why this is done. The bit of code that is doing this is in Incident_Library_kmprocesslibcriteria in ScriptLibrary. The line is:

           strQuery = " (logicalname: \"" KMQuery.incidentlib_logicalname "\" AND knowledgebase_name: Incident_Library)"

    If I change the code to:   

          strQuery = " (logicalname: " KMQuery.incidentlib_logicalname " AND knowledgebase_name: Incident_Library)";

    It then builds the query without the double quote wrap and returns records. I see this being done in a few places in this bit of scripting and the other kmprocesslibcriteria scripts. I just don't understand why since it certainly appears not to work correctly (or at least how I expect it to).