cancel
Showing results for 
Search instead for 
Did you mean: 

multiple instances of secondary keyword types with AFKWS?

Les_LaCroix
Champ in-the-making
Champ in-the-making

I cross-posted this over in the HE community; my apologies to those who see it twice.  (This posting is a little different, anyway.)

We are revisiting our Student AFKWS and want to add a couple keyword types for one of our offices.  One of the secondary keyword types is Major.  A relatively small number of students (about 1.5%) have two majors. 

If we were manually indexing (and weren't using keyword type groups?) we could make a second instance of the Major keyword type on the documents.  But I want to maintain the keywords from the student information system using an AFKWS processor.  

Am I correct in concluding that I cannot create a second instance of the Major keyword type on a document through an AFKWS?  I think that leaves me with three choices:

  1. Create two keyword types: Major1 and Major2 (and hope that I never see a triple major)
  2. Use a CSV for double major (e.g. "MATH,ECON") and train everyone who searches on major to always use wildcards (e.g. always search for "*MATH*)
  3. Throw away one of the Major keywords.
#3 probably isn't really an option.  Can someone confirm that I'm correct about the inability to add additional instances of secondary keyword types in an AFKWS?
We haven't been using multi-instance keyword type groups, but I expect we ought to be.  Some of the documents would want to be indexed under multiple students.  Would using them either hurt or help?
Thanks in advance, -Les
2 REPLIES 2

Scott_Johnson3
World-Class Innovator
World-Class Innovator

Hi Les

I have this exact type of case for some of my AFKWS.  You can do what you want.  In setting set "expand All Matching Instance". 

I hope this helps (BTW I am on 12  But first used it in 10)

Scott

Here is an example Vb code (note rule_nbr may have multiple values):

Sub GetKeywordSetRecords(primaryvalue, keysetdef, results)
    Set conn = CreateObject("ADODB.Connection")
        conn.ConnectionString = "DSN=<DSNNAME>;"
        
    conn.Open()

        Dim rs
        Dim txt
        Dim strQuery
    Dim primaryval
    primaryval =  primaryvalue

    txt = "  My Query String ...."

    strQuery = Replace(txt, "_filter_", trim(primaryval))
    set rs = conn.execute(strQuery)

    If (Not rs.EOF) Then
        Call rs.MoveFirst
        dim RecFound
        RecFound = false
    
        Do While Not rs.EOF
        Dim keyvalue

        Call results.BeginRow()
        
        keyvalue = rs("fac_id")
        If Not Isnull(keyvalue) Then
                   Call results.AddData("Facility ID", keyvalue)
        End If

        keyvalue = rs("case_nbr")
        Call results.AddData("HB Case Nbr", keyvalue)

        keyvalue = rs("name")
        If Not Isnull(keyvalue) Then
                   Call results.AddData("Facility Name", keyvalue)
        End If

        keyvalue = rs("address")
        If Not Isnull(keyvalue) Then
                   Call results.AddData("Address", keyvalue)

                   keyvalue = rs("hb_city")
                   Call results.AddData("City", keyvalue)
    
                   keyvalue = rs("hb_zip")
                   Call results.AddData("Zip Code", keyvalue)
        Else
                   keyvalue = rs("address2")
                   If Not Isnull(keyvalue) Then
                       Call results.AddData("Address", keyvalue)

                       keyvalue = rs("city")
                       Call results.AddData("City", keyvalue)
    
                       keyvalue = rs("zip")
                       Call results.AddData("Zip Code", keyvalue)
                  End If
        End If


        keyvalue = trim(rs("rule_nbr"))
        If Not Isnull(keyvalue) Then
                   Call results.AddData("Rule Nbr", keyvalue)
        End If
            
        Call results.EndRow()
        RecFound = true
        Call rs.MoveNext
        Loop
    Else
    'No records found
    End If

    rs.close
    set rs = nothing
    conn.close
    set conn = Nothing

End Sub

Les_LaCroix
Champ in-the-making
Champ in-the-making

Scott, is that code for an External AFKWS?  I don't think I can use an External AFKWS: I'm trying to update keyword sets and also keyword values on existing documents as changes occur in our ERP.  I know how to do that with an AFKWS Processor, but I didn't think you could do that with External AFKWS?