Skip to main content
Participant
July 3, 2021
Answered

Maximum size of Index?

  • July 3, 2021
  • 3 replies
  • 537 views

I have developed a very large book over the last 20 years, using various versions of FM. I currently use the most recent version & update. The book contains an Index of more than 100 pages of double column format. Recently, I have noticed that Index marks that I have added to the book have not appeared in the Index after subsequent updates of the book. Is there a maximum number of indexes that can be incorporated into a book?

If not, can anyone suggest what might solve my problem of missing entries in the Index?

Thanks in advance for any help that may be given!

    This topic has been closed for replies.
    Correct answer Bob_Niland

    Top suspects might include (but are not limited to):

    • .ix component file has lost its "generated" status and is not being regenerated
    • generation is happening, but .ix file is being written somewhere else, or is unwriteable for some reason, so not being updated
    • new tagged content isn't using the same Marker type as the legacy content

    I'm not aware of any limit on the max number of Index entries.

    3 replies

    frameexpert
    Community Expert
    Community Expert
    July 6, 2021

    One way you may be able to determine if there is a limit: count the Index markers in the book. Then count the number of Hypertext marker in the index. These numbers may not correspond exactly if any of your Index markers have semicolons in them for multiple entries per marker. Anyway, I will post a script that you can use to count markers in a document or book. You supply the marker type in the call to the main function.

    frameexpert
    Community Expert
    Community Expert
    July 6, 2021

     

    #target framemaker
    
    main ("Index");
    
    function main (markerType) {
    
        var book, doc, count;
    	
    	book = app.ActiveBook;
    	if (book.ObjectValid () === 1) {
    	    count = processBook (book, count, markerType);
    		alert (count + " " + markerType + " markers in book.", "www.frameexpert.com");
    	}
    	else {
    		doc = app.ActiveDoc;
    	    if (doc.ObjectValid () === 1) {
    		    count = processDoc (doc, count, markerType);
    		    alert (count + " " + markerType + " markers in document.", "www.frameexpert.com");
    		}
    	}
    }
    
    function processDoc (doc, count, markerType) {
    
    	var marker;
    	
    	count = count ? count : 0;
    	
    	marker = doc.FirstMarkerInDoc;
    	while (marker.ObjectValid () === 1) {
    		if (marker.MarkerTypeId.Name === markerType) {
    			count += 1;
    		}
    		marker = marker.NextMarkerInDoc;
    	}
    	
    	return count;
    }
    
    function processBook (book, count, markerType) {
    
        var bookComp, doc, regex;
        
        // Regular expression for standard FrameMaker documents.
        regex = /\.fm$/i;
        
        // Loop through all of the components in the book.
        bookComp = book.FirstComponentInBook;
        while (bookComp.ObjectValid () === 1) {
            if (bookComp.ExcludeBookComponent === 0) {
                if (regex.test (bookComp.Name) === true) {
                    // Get the document returned in a JavaScript object.
                    doc = CP.getDocument (bookComp.Name, undefined, false);
                    if ((doc) && (doc.ObjectValid () === 1)) {
                        book.StatusLine = "Processing " + File (bookComp.Name).displayName;
                        // Call the function to get the document's data.
    					count = processDoc (doc, count, markerType);
                        // If the document was opened by the script, close it.
                        if (doc.openedByScript === true) {
                            doc.Close (true);
                        }
                    }
                }
            }
            bookComp = bookComp.NextBookComponentInDFSOrder;
        }
    
        // Reset the book status line.
        book.StatusLine = "";
    	
    	return count;
    }
    

     

    frameexpert
    Community Expert
    Community Expert
    July 6, 2021

    Copy the code from the post into a plain text file and save it somewhere as CountMarkers.jsx. Then, open your FrameMaker book and choose File > Script > Run and choose the script. Note that on a large book, it will take some time to run. It will display the marker count when finished.

     

    Next, change main ("Index"); to main ("Hypertext");, save the script and open the Index and run it again. See if there is a mismatch between the Index and Hypertext counts.

     

    If you need help with this, please contact me offlist: rick at frameexpert dot com

    Community Expert
    July 5, 2021

    When I add a new index marker, sometimes I insert a marker of another type. Did you check this in your new markers?

    Bob_Niland
    Community Expert
    Bob_NilandCommunity ExpertCorrect answer
    Community Expert
    July 3, 2021

    Top suspects might include (but are not limited to):

    • .ix component file has lost its "generated" status and is not being regenerated
    • generation is happening, but .ix file is being written somewhere else, or is unwriteable for some reason, so not being updated
    • new tagged content isn't using the same Marker type as the legacy content

    I'm not aware of any limit on the max number of Index entries.

    K.Daube
    Community Expert
    Community Expert
    July 4, 2021

    There may be the limit of maximum number of document objects. For the 32-bit versions of FM this is 2^24. For a calculations an index entry consists of some (probable 5-10) document objects. But IMHO this limit will not be reached by your index: 120pages * 2 columns * 50 lines * 10 objects is only 120 000 < 16 million...

    The internal context table is a memory construct that holds many types of FrameMaker document objects. The following table illustrates the different entries and their requirements.
    Element: 2 entries; Variable: 2 entries; Cross-reference: 2 entries; Marker (any type): 1 entry; Table: 1 entry; Aanchored frame: 1 entry; Hidden conditional text: 1 entry per block. In FrameMaker 5.5, maximum number of entries is 2^24 (16 777 216). This may be extended in the 64-bit version (since FM-15). See https://www.daube.ch/docu/fmaker25.html