Skip to main content
Participant
December 3, 2014
Question

Index sort order with underscore (_)

  • December 3, 2014
  • 1 reply
  • 537 views

Hi. 

According to the documentation, the default sort order for indexes is <$symbols><$numbers><$alphabetics> with hyphens, nonbreaking hyphens, en dashes, and em dashes ignored by default.  Nothing about underscores, so they should be sorted on first, right?  But they are not in my document.  Example:

PaymentModule_Order_Head

PaymentModule_OrderPayment_Capture

PaymentModule_Order_Tabs

What I want to see is:

PaymentModule_Order_Head

PaymentModule_Order_Tabs

PaymentModule_OrderPayment_Capture

Is there an easy way to fix this so underscores have precedence over alphabetics?  I've tried rearranging the building blocks every which way but nothing seems to work.

    This topic has been closed for replies.

    1 reply

    Arnis Gubins
    Inspiring
    December 4, 2014

    Looks like FM is also ignoring the underscores, so in order to force the desired sort order, you have to add a sort override key after the index entry in square brackets, e.g.

    PaymentModule_Order_Head[PaymentModuleOrderHead]

    PaymentModule_OrderPayment_Capture[PaymentModuleOrderZPaymentCapture]  <--- note the "Z" to force the sorting further down the list. You could use other values depending upon what your other index entries are like.

    PaymentModule_Order_Tabs[PaymentModuleOrderTabs]

    Also, again depending upon what other index entries you have, you might be able to abbreviate such override keys to something like [PMOHead], [PMOZPaymentCapture]. etc.

    EMLinSDAuthor
    Participant
    December 6, 2014

    Thanks for the reply, but your solution would require going through thousands of index entries and adding the sort order text.  Is there no way to specify "_" as a sort key in the index itself (e.g. on the Reference page)?  FrameMaker is not behaving has doc'd here.

    Bob_Niland
    Community Expert
    Community Expert
    December 6, 2014

    > ... going through thousands of index entries and adding the sort order text.

    That could be scripted, using dedicated Frame scripting tools, or, with MIF, ordinary text processing tools. Someone may even have done it already.

    In MIF, it would "merely" be a matter of first batch converting all:

      <MTypeName `Index'>
      <MText `what appears in Index'>

    pairs to:

    <MTypeName `Index'>
      <MText `what appears in Index[M00what appears in Index]'>

    then hand edit only the Markers of the outliers to change the arbitrary "M00" prefix to whatever is needed to optimize the sort rank.

    > FrameMaker is not behaving has doc'd here.

    You have documentation for FrameMaker?
    Why wasn't I told about this?