Tuesday, April 14, 2026

How to Install Elastic Search


πŸ“š Why Elasticsearch + Unicode Matters

Traditional search engines struggle with:

  • Diacritics (e.g., Ψ²Ψ¨Ψ±، زیر)

  • Word variations

  • Complex scripts like Arabic and Urdu

Elasticsearch, combined with the ICU analyzer, solves this by:

  • Normalizing Unicode text

  • Ignoring diacritics

  • Improving tokenization for non-Latin scripts

πŸ‘‰ Result: Users can search “Ψ§Ψ³Ω„Ψ§Ω…”, “Ψ§Ω„Ψ₯Ψ³Ω„Ψ§Ω…”, or even slightly misspelled variants and still get accurate results.


⚙️ Step 1: Install Elasticsearch

Install Java (Prerequisite)

sudo apt update
sudo apt install openjdk-11-jdk -y

Install Elasticsearch (Compatible Version)

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.17.0-amd64.deb
sudo dpkg -i elasticsearch-7.17.0-amd64.deb

🌐 Step 2: Configure Elasticsearch

Edit configuration:

sudo nano /etc/elasticsearch/elasticsearch.yml

Add:

cluster.name: koha-cluster
node.name: koha-node-1
network.host: 127.0.0.1
http.port: 9200

🌍 Step 3: Enable Unicode Support (ICU Plugin)

This is the most critical step for multilingual libraries.

sudo /usr/share/elasticsearch/bin/elasticsearch-plugin install analysis-icu
sudo systemctl restart elasticsearch

πŸ” Why ICU?

The ICU plugin enables:

  • Unicode normalization

  • Proper handling of Arabic/Urdu morphology

  • Diacritics-insensitive search


πŸ”— Step 4: Connect Koha with Elasticsearch

Install integration package:

sudo apt install koha-elasticsearch -y

Enable Elasticsearch in Koha:

sudo nano /etc/koha/koha-sites.conf

Add:

elasticsearch: 1

🧠 Step 5: Configure Unicode Analyzer in Koha

Edit mapping file:

/etc/koha/sites/library/elasticsearch/mappings/biblios.yaml

Add a custom analyzer:

analyzer:
  my_unicode_analyzer:
    type: custom
    tokenizer: standard
    filter: [lowercase, icu_normalizer]

πŸ”„ Step 6: Rebuild Index

sudo koha-elasticsearch --rebuild -v -f library

This step ensures all bibliographic records are indexed with Unicode support.


⚡ Step 7: Enable Plack for High Performance

Koha without Plack reloads Perl for every request—this slows everything down.

With Plack:

  • Faster OPAC

  • Reduced server load

  • Persistent processes

Install Plack

sudo apt install libplack-perl -y

Enable Plack

sudo nano /etc/koha/koha-sites.conf

Add:

plack: 1

πŸ”§ Step 8: Configure Plack Workers

Edit:

/etc/koha/sites/library/koha-conf.xml

Add:

<plack_workers>5</plack_workers>

▶️ Step 9: Start Plack

sudo koha-plack --enable library
sudo koha-plack --start library

Restart everything:

sudo systemctl restart apache2
sudo systemctl restart elasticsearch
sudo koha-plack --restart library

πŸ§ͺ Testing Your Setup

Try searching in OPAC:

  • Ψ§Ψ³Ω„Ψ§Ω…

  • Ψ§Ω„Ω‚Ψ±Ψ’Ω†

  • Hadith / حدیث

✔ Expected results:

  • Diacritics ignored

  • Variants matched

  • Faster response


⚠️ Common Issues & Solutions

Elasticsearch not responding

curl http://localhost:9200

Unicode search not working

  • Check ICU plugin installation

  • Rebuild index

Plack not running

sudo koha-plack --status library

πŸ“ˆ Performance Optimization Tips

  • Set Elasticsearch memory:

/etc/elasticsearch/jvm.options
-Xms1g
-Xmx1g
  • Use 4–8 Plack workers depending on RAM

  • Schedule regular indexing for large catalogs


πŸ”¬ Advanced Enhancements

Take your Koha to the next level:

  • Synonym filters for Islamic terminology

  • Autocomplete using edge-ngram

  • Authority control integration

  • Relevance ranking (boost title fields)


πŸ“– Conclusion

By integrating Elasticsearch with Unicode support and enabling Plack, your Koha becomes:

  • Multilingual

  • Faster

  • More intelligent

This setup is especially critical for institutions dealing with Islamic studies, Arabic, and Urdu collections, where traditional search fails to deliver precision.


πŸ“š Further Reading (For Deeper Understanding)

  • Multilingual Information Retrieval Systems

  • Unicode Normalization and ICU Standards

  • Elasticsearch Indexing & Ranking Algorithms

  • Koha Architecture (Zebra vs Elasticsearch)

  • PSGI/Plack Performance Engineering


πŸ“‘ References

  • Koha Community Documentation (Elasticsearch Integration)

  • Elasticsearch Official Documentation (Analysis Plugins)

  • Unicode ICU Documentation

  • PSGI/Plack Perl Framework Guides


If you want, I can also prepare:

  • A fully optimized Urdu/Arabic biblios.yaml file

  • A ready-to-deploy Koha DevOps script

  • Or a research paper-style write-up for publication

Monday, April 13, 2026

How to Fix “Connection Refused” Error in PuTTY While Accessing a Virtual Machine

Abstract

When attempting to access a virtual machine using PuTTY, users often encounter the error “Network error: Connection refused.” This issue indicates that the target system is reachable, but the SSH service is either not running or not accepting connections on the specified port. This blog provides a clear, practical, and technically grounded guide to diagnose and resolve the problem effectively.


Introduction

Secure remote access is a fundamental requirement in modern system administration. Tools like PuTTY allow users to connect to Linux-based virtual machines using the SSH protocol. However, connection errors can interrupt workflows, especially in environments such as Koha library systems or cloud-based servers.

One of the most common issues is:

PuTTY Fatal Error: Network error: Connection refused

Understanding the root cause is essential for resolving it quickly.


What Does “Connection Refused” Mean?

This error occurs when:

  • Your system successfully reaches the server’s IP address

  • But the server rejects the connection request on the specified port

Technically, this means:

  • No service (like SSH) is listening on that port

  • Or a firewall is actively blocking the connection


Step-by-Step Troubleshooting Guide

1. Verify SSH Service Status

The most common cause is that the SSH service is not running.

Log in to your VM locally (or via console) and run:

sudo systemctl status ssh

If inactive, start it:

sudo systemctl start ssh
sudo systemctl enable ssh

If SSH is not installed:

sudo apt update
sudo apt install openssh-server

2. Confirm SSH Port Configuration

SSH runs on port 22 by default, but it may be changed for security reasons.

Check configuration:

sudo nano /etc/ssh/sshd_config

Look for:

Port 22

If the port is different (e.g., 2222), update PuTTY accordingly.


3. Check Firewall Settings

On Ubuntu (UFW):

sudo ufw status

Allow SSH if needed:

sudo ufw allow 22
sudo ufw reload

A blocked port will prevent SSH connections even if the service is running.


4. Ensure SSH Port is Listening

Run:

ss -tulnp | grep :22

Expected output:

LISTEN 0 128 0.0.0.0:22

If no output appears, SSH is not active.


5. Test Connectivity from Client Machine

From your local computer:

ping 10.40.3.125
telnet 10.40.3.125 22

Interpretation:

  • Ping works → Network is fine

  • Telnet fails → SSH service issue


6. Check Virtual Machine Network Configuration

If using VMware or VirtualBox:

  • NAT mode may restrict access

  • Switch to Bridged Adapter for direct network access

This is a frequent issue in local virtual environments.


7. Restart SSH Service

After changes:

sudo systemctl restart ssh

8. Reconnect Using PuTTY

In PuTTY:

  • Host Name: 10.40.3.125

  • Port: 22 (or custom)

  • Connection Type: SSH

Click Open and log in.


Practical Insight: Why This Happens in Koha Environments

In systems like Koha (as seen in your case running on port 8080):

  • Web interface works → server is active

  • SSH fails → service not enabled or blocked

This often occurs in:

  • Fresh installations

  • Minimal Linux setups

  • Security-hardened environments


Security Considerations

  • Prefer key-based authentication over passwords

  • Restrict SSH access using firewall rules

  • Disable root login in production

  • Consider changing the default SSH port


Conclusion

The “Connection refused” error is not a network failure but a service-level issue. By systematically verifying SSH service status, port configuration, firewall rules, and VM networking, the problem can be resolved efficiently. Mastering these diagnostics is essential for anyone working with virtual machines, especially in research, library systems, and cloud environments.


Suggested Further Reading

To deepen your understanding, explore:

  • SSH Key-Based Authentication and Security

  • Linux System Services (systemctl)

  • Firewall Management (UFW and iptables)

  • Virtual Machine Networking (NAT vs Bridged)

  • Remote Server Administration Best Practices

  • Koha System Deployment and Server Configuration


References

  1. Barrett, D. J., Silverman, R. E., & Byrnes, R. G. SSH, The Secure Shell: The Definitive Guide. O’Reilly Media.

  2. Nemeth, E., Snyder, G., & Hein, T. UNIX and Linux System Administration Handbook. Pearson.

  3. Ubuntu Documentation. OpenSSH Server Guide.

  4. Ylonen, T., & Lonvick, C. (2006). The Secure Shell (SSH) Protocol Architecture. RFC 4251.


Monday, April 6, 2026

Enhancing Koha OPAC: Display Item Types with Icons (Koha 25.11 Guide)

Enhancing Koha OPAC: Display Item Types with Icons (Koha 25.11 Guide)

If you're using Koha 25.11 and want to improve your OPAC interface, one powerful customization is displaying item types (Book, Thesis, Article, etc.) with icons alongside each bibliographic record.

This improves usability and gives your OPAC a more modern, professional look.

In this guide, we’ll walk through a complete, working solution to achieve this.


πŸš€ Why Display Item Types?

By default, Koha OPAC may not clearly highlight the type of material in search results. Adding item types helps users quickly identify:

  • πŸ“˜ Books

  • πŸŽ“ Theses

  • πŸ“° Articles

  • πŸ“œ Manuscripts

  • πŸ“– Periodicals


πŸ” Understanding the Data

Koha stores item types in two places:

  • Database (itemtypes table) → codes like BK, THES

  • MARC field 942$c → often contains descriptions like Books, Thesis

⚠️ Important:
XSLT reads MARC data, so you must match values like:

Books (not BK)

πŸ› ️ Step 1: Add Icon Files

Create a folder for item type icons:

/usr/share/koha/opac/htdocs/opac-tmpl/bootstrap/images/itemtypes/

Add your icon images:

book.png
thesis.png
article.png
manuscript.png
periodical.png
default.png

🧩 Step 2: Modify XSLT File

Open the OPAC XSLT file:

/usr/share/koha/opac/htdocs/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl

Inside the template:

<xsl:template match="record">

Insert the following code where you want the item type to appear (usually near the title):

<!-- ===== ITEM TYPE WITH ICON START ===== -->

<xsl:variable name="itype" select="normalize-space(marc:datafield[@tag='942']/marc:subfield[@code='c'])"/>

<span class="itemtype-label">

    <xsl:choose>

        <xsl:when test="$itype='Books'">
            <img src="/opac-tmpl/bootstrap/images/itemtypes/book.png" class="itemtype-icon"/>
            Book
        </xsl:when>

        <xsl:when test="$itype='Thesis'">
            <img src="/opac-tmpl/bootstrap/images/itemtypes/thesis.png" class="itemtype-icon"/>
            Thesis
        </xsl:when>

        <xsl:when test="$itype='Articles'">
            <img src="/opac-tmpl/bootstrap/images/itemtypes/article.png" class="itemtype-icon"/>
            Article
        </xsl:when>

        <xsl:when test="$itype='Manuscript'">
            <img src="/opac-tmpl/bootstrap/images/itemtypes/manuscript.png" class="itemtype-icon"/>
            Manuscript
        </xsl:when>

        <xsl:when test="$itype='Periodicals'">
            <img src="/opac-tmpl/bootstrap/images/itemtypes/periodical.png" class="itemtype-icon"/>
            Periodical
        </xsl:when>

        <xsl:otherwise>
            <img src="/opac-tmpl/bootstrap/images/itemtypes/default.png" class="itemtype-icon"/>
            <xsl:value-of select="$itype"/>
        </xsl:otherwise>

    </xsl:choose>

</span>

<!-- ===== ITEM TYPE WITH ICON END ===== -->

🎨 Step 3: Add Styling

Go to:

Koha → Administration → System Preferences → OPACUserCSS

Add:

.itemtype-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.itemtype-icon {
    width: 18px;
    height: 18px;
}

πŸ”„ Step 4: Restart Services

Run:

sudo systemctl restart koha-common
sudo systemctl restart apache2

Then refresh your browser (Ctrl + F5).


🎯 Final Result

Your OPAC search results will now display clean, visual item types like:

  • πŸ“˜ Book

  • πŸŽ“ Thesis

  • πŸ“° Article

  • πŸ“œ Manuscript

  • πŸ“– Periodical

Each with a matching icon and label.


⚠️ Troubleshooting

Icons not showing?

  • Check file path:

/opac-tmpl/bootstrap/images/itemtypes/book.png
  • Test in browser:

http://your-koha/opac-tmpl/bootstrap/images/itemtypes/book.png

Wrong item type showing?

  • Verify MARC field:

942$c
  • Ensure values match exactly:

Books, Thesis, Articles, Manuscript, Periodicals

πŸ’‘ Pro Tips

  • Use SVG icons for better quality

  • Keep icon sizes consistent

  • Avoid hardcoding too many conditions — keep it maintainable


πŸŽ‰ Conclusion

With just a small XSLT customization, you can significantly enhance the user experience of your Koha OPAC. Clear item type labels and icons make browsing faster, easier, and more visually appealing.


πŸš€ What’s Next?

You can further enhance your OPAC by:

  • Adding filters by item type

  • Grouping results (Books / Theses / Journals)

  • Customizing the detail page layout


If you need help with advanced customization, feel free to explore further or extend this implementation.

Happy customizing! 🎯

Sunday, March 29, 2026

Mastering Metadata Cleanup in MarcEdit

Mastering Metadata Cleanup in MarcEdit

Mastering Metadata Cleanup in MarcEdit

Cleaning metadata in MarcEdit is a systematic process. It typically begins by "breaking" a .mrc (binary) file into the mnemonic .mrk (text) format, performing batch edits, and then compiling it back into .mrc.

1. Batch Deleting Unwanted Fields

To remove entire tags (like local 9XX fields or vendor-specific 655 tags) across your entire file:

  • Path: Tools > Add/Delete Field (Shortcut: F7)
  • Example: Removing all 949 local call number fields.
  • Action: Enter 949 in the Field box and click Delete Field.

Pro Tip: Use the Preview button first. It’s the best way to ensure you aren't accidentally deleting essential data.

2. Targeted Subfield Editing

Use this when you need to change data within a field, such as stripping proxy prefixes from URLs or fixing punctuation.

Path: Tools > Edit Subfield Data (Shortcut: F9)
Goal Field / Subfield Field Data Replace With
Remove "Electronic book" from 655 655 / a Electronic book. (Leave Empty)
Update Proxy Prefix in 856 856 / u oldproxy.com/ newproxy.com/
Add trailing period to 245 245 / a ([^.])\s*$ $1. (Check Regex)

3. Updating Indicators

Indicators control how data is indexed. A common task is fixing the second indicator in the 245 field to account for "The" or "A".

  • Path: Tools > Edit Indicators (Shortcut: F8)
  • Example: Changing 050 \4 (Local LC Call Number) to 050 00 (LC assigned by LC).

4. Modernizing with the RDA Helper

The RDA Helper automates the transition from AACR2 to modern RDA standards.

  • Path: Tools > RDA Helper
  • What it does:
    • Adds 336 (Content), 337 (Media), and 338 (Carrier) fields.
    • Converts abbreviations (e.g., "p." to "pages").
    • Removes the 245 $h [electronic resource] GMD.

5. Global Find/Replace & Regex

For general text cleaning (like fixing typos or removing specific phrases), use Edit > Replace (Ctrl+H). For complex patterns, enable Use Regular Expressions.

Regex Example: To find cases where a subfield $b is missing a leading space, search for ([^\s])\$b and replace with $1 $b.

Once your edits are complete, navigate to File > Compile File to save your work back into the .mrc format for your ILS.

Saturday, March 28, 2026

Display in OPAC of Different datatypes

⚠️
Diagnosis: Your Koha is defaulting to "text" because the Item Type Codes in your MARC (952$y) do not match the codes in your Koha Administration.
Solution 1: Define Item Types in Koha Admin

Go to Koha Administration → Item types and create these entries exactly as they appear in your MARC data:

Code (Must match 952$y) Description Suggested Icon
BK Book bridge/book.gif
ARTICLE Journal Article bridge/periodical.gif
THESIS Research Thesis bridge/thesis.gif
BIBLIO Bibliographic Entry bridge/reference.gif
Solution 2: Adjust MARC Leader (LDR) for Theses

If an item is missing, Koha looks at Position 06 of the Leader. To differentiate theses from standard books:

  • Books/Articles: Set Position 06 to a (Language material).
  • Theses/Manuscripts: Change Position 06 to t (Manuscript language material).
MarcEdit Fix: Click the LDR field → Type of Record → Select "t-Manuscript language material".
Solution 3: Enable XSLT System Preferences

Ensure your system is configured to show icons in the OPAC:

  1. Search for DisplayOPACiconsXSLT → Set to Show.
  2. Search for OPACNoItemTypeImages → Set to Show (this enables images).
Solution 4: Collection Codes (CCODE)

To see "Sirah Hub" or "SNK Bibliography" clearly next to the item type, add Collection Codes:

  1. Go to Admin → Authorized values → CCODE.
  2. Add values: SIRAH (Sirah Research Hub) and SNK (Sher Nowrooz Khan).
  3. Add the tag to your MARC: =952 \\$8SNK

Standardizing these administrative settings ensures your scholarly Hub is visually organized and professional for researchers.

Marc Tags of Different Data Types

Koha 25.11 "Sirah Hub" Test Suite

MARC21 Record Samples for Multilingual & Scholarly Validation

1. Physical Book (Multi-Holding) Consolidation Test
=LDR 00000nam 2200000ia 4500 =001 hub-book-001 =020 \\$a9789694080123 =100 1\$aNomani, Shibli. =245 10$aSirat-un-Nabi /$cShibli Nomani. =260 \\$aLahore :$bReligious Publications,$c2010. =952 \\$aIRI$bIRI$pML100445-IRI$yBK$t1$o297.63 NOM =952 \\$aSSMK$bSSMK$p120684-SSMK$yBK$t1$o297.63 NOM
2. Journal Article (Analytical Entry) 773 Linking Test
=LDR 00000nab 2200000ia 4500 =001 hub-art-001 =100 1\$aAhmad, Zohaib. =245 10$aProphetic Diplomacy in the Medinan Period :$ba bibliometric review. =773 0\$tJournal of Islamic Thought and Civilization$gVol. 10, No. 2 (2025)$x2070-0326 =856 40$uhttps://define.pk/articles/prophetic-diplomacy.pdf$zFull Text PDF
3. Thesis/Dissertation 502 Academic Test
=LDR 00000nam 2200000ia 4500 =001 hub-thesis-001 =100 1\$aAhmed, Rauf. =245 10$aMapping Sirah Literature in Pakistan :$ba comparative study of digital repositories. =502 \\$bPh.D.$cInternational Islamic University, Islamabad$d2026.
4. Virtual Bibliographic Citation (SNK) 510 Citation Test
=LDR 00000nam 2200000ia 4500 =001 hub-snk-045 =100 1\$aHamidullah, Muhammad. =245 10$aThe Life and Work of the Prophet of Islam. =510 4\$aSher Nowrooz Khan, Bibliography of Sirah Literature$cEntry No. 45. =952 \\$aSNK_BIB$bSNK_BIB$pSNK-45$yBIBLIO$t1$oREF SNK-45

πŸ” Validation Checklist

  • The "Split" Display: Does "Nomani" show both IRI and SSMK availability in the OPAC results?
  • Link Integrity: Is the "Full Text PDF" link in the Article record clickable?
  • Note Visibility: Does the 510 tag appear clearly in the "Description" or "Notes" tab of the Hamidullah record?
  • Virtual Branch: Verify that the SNK_BIB item is listed as "Not for Loan."

The SNK Bibliography Strategy

The SNK Bibliography Strategy

Integrating Historical Citations into the Modern Hub

Managing the Sher Nowrooz Khan (SNK) bibliography requires a shift in perspective. We are not just cataloging books; we are performing a Bibliometric Mapping of Sirah literature, acknowledging the history of its documentation.

1. The "Virtual Branch" Concept

In Koha, create a library code specifically for this bibliography: SNK_BIB. This allows you to track items that exist in the "world index" even if you don't physically own them yet.

  • The Barcode: Use the Entry Number from the printed bibliography (e.g., SNK-124).
  • The Status: Set these to a custom "Not for Loan" status: Bibliographic Citation Only.

2. Scholarly Acknowledgement (Tag 510)

To give Sher Nowrooz Khan proper "Academic Credit," use MARC Tag 510. This formally links the record to his scholarly work.

510 $a: Sher Nowrooz Khan, Bibliography of Sirah Literature
510 $c: Entry No. 124

Result: Users see a note stating: "This book is acknowledged/cited in Sher Nowrooz Khan's Bibliography."

Handling the 4 SNK Entry Types

Entry Type Hub Action Deduplication Strategy
Books Create "Master Record" Match by ISBN/Title. Merge physical holdings into one 510 tag.
Journal Articles Create "Analytical Record" Use 773 tag to link to the Journal title.
Theses Create "Thesis Record" Match by Author+Title. Use 502 tag for University info.
Library Holdings Location Metadata Add an item with the NLP branch code if SNK cites it there.

The "Ghost Duplicate" Solution

To prevent having a "Physical Record" (IRI) and a "Cited Record" (SNK) as two separate entries, use the MarcEdit Merge Tool:

  1. Source: Your existing Koha records.
  2. Merge File: The SNK Bibliography records.
  3. Action: Tell MarcEdit to only add the 510 tag to the existing record instead of creating a new one.

This approach acknowledges that Sher Nowrooz Khan "found" these works before they were digitally available, adding immense historical value to your PhD research.

The Surgical Merge: MarcEdit Edition

Preserving Metadata Integrity for the Sirah Research Hub

Merging records in MarcEdit is like performing a surgical transplant: you take the "healthy" metadata from one file and move the "vital" local data (barcodes and URLs) from another into it.

The Scenario: A Practical Example

Imagine you have two separate files for the same 100 Sirah books:

File A (Source)

High-quality bibliography. Perfect titles and Islamic subject headings, but no barcodes.

File B (Merge)

SSMK Library records. Messy titles, but contains unique barcodes and shelf locations.

Goal: The Perfect Master Record

The Step-by-Step Process

1
Open the Merge Tool: Launch MarcEdit and navigate to Tools → Merge Records.
2
Select Your Files: Set File A as your Source and File B as your Merge file. Name your output Sirah_Hub_Final.mrc.
3
Define the "Match Key": Use the ISBN (020 $a) or Title (245 $a) so MarcEdit recognizes which books are identical.
4
Select Specific Data: Only check the boxes for fields you need from File B (e.g., 952 for barcodes, 856 for URLs).
πŸ’‘ Pro-Tip: Do NOT select fields like 245 (Title) or 100 (Author) in Step 4. You want to keep the "clean" metadata from your Source file, not overwrite it with the "messy" data from the Merge file.

The Final Result (Behind the Scenes)

Feature File A (Source) File B (Merge) Final Merged Result
Title (245) The Life of the Prophet Prophet Life (SSMK) The Life of the Prophet
ISBN (020) 9780123456789 9780123456789 9780123456789
Barcode (952$p) (Empty) ML-100444 ML-100444

Common Troubleshooting

  • "No Matches Found": Standardize your ISBNs first. One file might have dashes while the other does not. Use the MarcEdit ISBN Tool to fix this.
  • Duplicate 952s: Use the "Replace Existing" option in merge settings if your Source file already contains empty placeholder tags.

Merging in MarcEdit is faster and safer than merging in Koha because you can verify 5,000 records in seconds before they ever touch your live catalog.

From Fragmented Lists to an Authoritative Master Record

/h1>

From Fragmented Lists to an Authoritative Master Record

The greatest challenge in the Sirah Research Hub is duplication. When aggregating data from IRI, SSMK, and printed bibliographies, we must move from importing to merging.

The Goal: "One Record, Many Homes"

IRI Copy + SSMK Copy + Citation #402
Unified Sirah Master Record
1

Handling Physical Holdings (Merging)

If you have three repeating entries in Koha, use the Merge selected tool in the staff client. Pick the record with the "best" metadata as your reference. Koha will move the barcodes from the duplicates to this master record automatically.

Result: One search result shows availability at IRI, SSMK, and NLP simultaneously.
2

Handling Bibliographies (Citation Tags)

A bibliography entry is a citation, not a physical book. Instead of a new record, use MARC Tag 510 (Citation/References Note) inside the Master Record.

  • 510 $a: Name of Source (e.g., Sher Nowrooz Khan Bibliography)
  • 510 $c: Entry or Page Number (e.g., Item #142)
3

Preserving Academic Credit

Don't lose track of who cataloged the book first. Use MARC Tag 040 (Cataloging Source) to create a breadcrumb trail of contributions.

Example: 040 $a NLP $d IRI $d SSMK shows the original record came from NLP and was enriched by IRI and SSMK.

πŸ’‘ MarcEdit Pro-Tip: Before uploading, use the Deduplication Tool in MarcEdit to check your incoming file against your existing Koha export. This stops duplicates before they ever touch your database.

The AI-Driven Sirah Library

Practical Workflows for 2026 Library Standards

Using AI for your Sirah Research Hub is a practical necessity for handling the massive volume of data across multiple Pakistani libraries. By 2026, these tools have become the backbone of professional metadata standardization.

Method 1

AI-Powered Metadata Extraction

Don't type manually from scans or rare manuscripts. Use AI to act as your "Digital Typist."

Practical Example: Feed an image of a rare title page to an AI assistant (like Gemini 1.5 Pro). It extracts Title, Author, and Year into a CSV format ready for Koha import.

Result: Saves 15-20 minutes per title.

Method 2

Intelligent Subject Tagging

Determining if a book belongs under "Ghazwat" (Battles) or "Shama'il" (Character) is complex. AI can analyze deep content instantly.

Practical Example: Paste a Table of Contents into an LLM and ask for MARC 600/650 tags based on Library of Congress standards.
Method 3

Automated ALA-LC Romanization

Normalize author names like "Siddiqui" vs "Siddiqee" into a single, authorized form.

AI Action: Convert "سیرΨͺ Ψ§Ω„Ω†Ψ¨ΫŒ" and "Sirat-un-Nabi" into the standard ALA-LC authorized title string for consistent indexing.

Efficiency Comparison

Feature Manual Cataloging AI-Assisted Cataloging
Processing Speed 30-45 mins per record 5-10 mins per record
Subject Accuracy Limited to staff expertise Scholarly & Suggestive
Linguistic Support Manual translation/lookup Instant (100+ languages)

Start Today: Use the "Master Prompt"

Give your team this specific prompt to use with any AI tool to ensure high-quality Sirah metadata:

Copy & Paste This Prompt: "I am cataloging a Sirah book for the 'Sirah Research Hub'. Here is the description: [Paste Intro/Table of Contents]. Please generate a MARC21 record in text format (.mrk) including tags 100, 245, 260, 520, and 600. Ensure the subject heading follows LCSH standards and names follow ALA-LC romanization."

Implementation Tip: Use AI as a "Co-Pilot"—always have a librarian verify the AI-generated MARC tags before finalizing the record in Koha.

The AI-Driven Sirah Library

Practical Workflows for 2026 Library Standards

Using AI for your Sirah Research Hub is a practical necessity for handling the massive volume of data across multiple Pakistani libraries. By 2026, these tools have become the backbone of professional metadata standardization.

Method 1

AI-Powered Metadata Extraction

Don't type manually from scans or rare manuscripts. Use AI to act as your "Digital Typist."

Practical Example: Feed an image of a rare title page to an AI assistant (like Gemini 1.5 Pro). It extracts Title, Author, and Year into a CSV format ready for Koha import.

Result: Saves 15-20 minutes per title.

Method 2

Intelligent Subject Tagging

Determining if a book belongs under "Ghazwat" (Battles) or "Shama'il" (Character) is complex. AI can analyze deep content instantly.

Practical Example: Paste a Table of Contents into an LLM and ask for MARC 600/650 tags based on Library of Congress standards.
Method 3

Automated ALA-LC Romanization

Normalize author names like "Siddiqui" vs "Siddiqee" into a single, authorized form.

AI Action: Convert "سیرΨͺ Ψ§Ω„Ω†Ψ¨ΫŒ" and "Sirat-un-Nabi" into the standard ALA-LC authorized title string for consistent indexing.

Efficiency Comparison

Feature Manual Cataloging AI-Assisted Cataloging
Processing Speed 30-45 mins per record 5-10 mins per record
Subject Accuracy Limited to staff expertise Scholarly & Suggestive
Linguistic Support Manual translation/lookup Instant (100+ languages)

Start Today: Use the "Master Prompt"

Give your team this specific prompt to use with any AI tool to ensure high-quality Sirah metadata:

Copy & Paste This Prompt: "I am cataloging a Sirah book for the 'Sirah Research Hub'. Here is the description: [Paste Intro/Table of Contents]. Please generate a MARC21 record in text format (.mrk) including tags 100, 245, 260, 520, and 600. Ensure the subject heading follows LCSH standards and names follow ALA-LC romanization."

Implementation Tip: Use AI as a "Co-Pilot"—always have a librarian verify the AI-generated MARC tags before finalizing the record in Koha.

Sirah Research Hub

Sirah Research Hub

MARC21 Data Entry Checklist

1 Fixed Fields & Control Tags
  • LDR/07 Bibliographic Level: Set to m (Books) or a (Articles).
  • 008/15-17 Language: Use codes like urd, ara, or eng.
  • 008/24 Nature: Set to b (Bibliographies) or m (Theses).
  • 040 $a/$b Hub code and cataloging language.
2 Author & Title
  • 100 $a Main Author: Use authorized LC/Authority forms.
  • 245 $a/$b Title/Subtitle: Include honorifics (SAW) if on cover.
  • 246 $a Varying Title: For transliterated or alternative titles.
  • 082 $a DDC Classification: Use 297.63 for Sirah.
3 Specialized Sirah Tags
  • 502 $b/$c/$d (Theses): Degree, Institution, and Year.
  • 510 $a (Virtual Records): Citation Source (e.g., SNK No. 142).
  • 773 $t/$g (Articles): Analytical link to Host Journal.
  • 856 $u (Digital Link): URL to PDF or landing page.
4 Subject Headings
  • 600 00 $a Subject: Muhammad, $c Prophet, $d -632
  • 600 00 $x Subdivisions: Biography, Miracles, etc.
  • 600 00 $v Form: Bibliography, Theses, etc.
5 Local Item Data
  • 952 $a Home Library: Set to SNK, NLP, etc.
  • 952 $p Accession: Include prefixes (e.g., SNK-1001).
  • 952 $7 Loan Status: 1 (Virtual/Not for loan) or 0 (Physical).
πŸ’‘ Pro-Tip: Use Koha's "Edit as New" feature to duplicate recurring publisher or subject data for faster entry.

MARC21 Data Entry Checklist for Scholarly Standardization

πŸ“‹ Sirah Research Hub

MARC21 Data Entry Checklist for Scholarly Standardization

Use this checklist during your first data-entry session to balance the complexities of honorifics, multiple languages, and the distinction between physical and virtual records.

1 Fixed Fields & Control Tags The Identity
  • LDR/07 Bibliographic Level: Set to m (Books/Theses) or a (Journal Articles/Chapters).
  • 008/15-17 Language: Use standard codes (e.g., urd, ara, eng).
  • 008/24 Nature of Contents: Set to b for Bibliographies or m for Theses.
  • 040 $a/$b Hub identification and cataloging language.
2 Author & Title The Core
  • 100 $a Main Author: Use authorized versions (e.g., Ibn Hishām, Κ»Abd al-Malik).
  • 245 $a/$b Title/Subtitle: Keep honorifics (SAW) if on cover; matching rules handle them in the background.
  • 246 $a Varying form of Title: Useful for transliterated Urdu/Arabic titles.
  • 082 $a DDC Classification: Standard Sirah DDC is 297.63.
3 Specialized Sirah Tags Hub Value
  • 502 $b/$c/$d (Theses): Degree type, Institution, and Year.
  • 510 $a (Virtual Records): Citation Source (e.g., Sher Nowrooz Khan, No. 142).
  • 773 $t/$g/$w (Articles): Analytical link to the Host Journal or Book.
  • 856 $u (Digital Link): URL to PDF or landing page.
4 Subject Headings Searchability
  • 600 00 $a Standard Subject: Muhammad, $c Prophet, $d -632.
  • 600 00 $x General subdivision (e.g., Biography, Miracles, Prophetic office).
  • 600 00 $v Form subdivision (e.g., Bibliography, Juvenile literature, Theses).
5 Local Item Data Location
  • 952 $a Home Library: Set to your code (e.g., SNK, NLP).
  • 952 $p Accession Number: Use prefixes like SNK-1001.
  • 952 $7 Not for Loan: Set to 1 (Virtual) or 0 (Physical).

πŸ’‘ Pro-Tips for Success

The "Copy" Trick: Use Koha’s "Edit as New (Duplicate)" to maintain consistency in Publisher (260) and Subject (600) tags.

Authority Check: Always use the "Tag Editor" icon next to the Author field to link records to a single authorized name entry.

The Sirah Research Hub Master Plan

"Building a Sirah Research Hub is a multi-layered project that transforms a standard library catalog into a sophisticated scholarly ecosystem. To succeed, you must balance technical precision with the unique requirements of Islamic scholarship."

Turning a Koha instance into a dedicated portal for Prophetic Biography (SAW) requires a strategic, phased approach. Here is your complete, step-by-step master plan.

Phase 1: Preparation & Policy (Month 1)

Before touching the software, define your "Sirah Standard."

1. Identify Your "Libraries" (Sources)

  • Physical Libraries: National Library (NLP), IRI (IRI), Punjab University (PUL).
  • Virtual Libraries: Sher Nowrooz Khan (SNK), Hamidullah (HAM).

2. Standardize Language & Script

Ensure UTF-8 support for Urdu, Arabic, and European languages. Establish a Normalization Rule: Strip honorifics (SAW, RA) for database matching, but retain them for the public display.

Phase 2: Technical Setup (Month 2)

1. Framework Customization

Create three specific MARC frameworks to ensure clean data entry:

  • Sirah-Book Includes ISBN (020) and Physical Description (300).
  • Sirah-Thesis Mandatory Dissertation note (502) and Supervisor (500).
  • Sirah-Article Optimized for journal analytics via Host Item Link (773).

2. Matching Rules

Set a "Deep Match" rule to prevent duplicates: ISBN Match (100% score) or a combination of Title + Author + Year.

Phase 3: Data Ingestion (Months 3–6)

Layer 1: The Virtual Backbone

Import established bibliographies (like Sher Nowrooz Khan) first. Catalog entries as "Virtual" items and use Tag 510 to note the source and entry number.

Layer 2: The Physical Audit

Harvest data from IIUI and the National Library using Z39.50. When a physical book matches a virtual record, Koha merges them, showing the user exactly where to find the text in Pakistan.

Workflow Summary

Goal Action Koha Tool
Identity Prefix Accession Numbers MarcEdit / Templates
Accuracy Strip honorifics for matching MARC Mod Templates
Variety Add Articles & Theses 773 & 502 Tags
Visibility Create Collection Portals HTML/CSS Customization

Your First Step

I recommend creating your 3-letter Library Codes for your top 5 sources today. This prevents "Accession Number Clash" from the very first record you import.

Building a Professional Sirah Research Hub Branding in Koha

Building a Professional Sirah Research Hub Branding in Koha

To create a professional Sirah Research Hub branding in Koha, you need to utilize the "HTML Customization" tools. By treating your publishers and source bibliographies as "Libraries," we can create a grid of icons that act as direct portals to each collection.

Here is your step-by-step guide to building this layout.

Step 1: Branding and "Quick-Links" Code

Paste this code into Tools > HTML Customizations > OpacMainUserBlock. This block appears in the center of your OPAC home page.

HTML Content (OpacMainUserBlock)
<div class="sirah-hub-header" style="text-align: center; padding: 20px; background: #f4f4f4; border-radius: 10px; margin-bottom: 30px;">
    <h1 style="color: #2c3e50; font-weight: bold;">Sirah Research Hub</h1>
    <p style="font-size: 1.2em; color: #7f8c8d;">A Unified Portal for Prophetic Biography Studies (SAW)</p>
</div>

<div class="container-fluid">
    <div class="row" style="display: flex; flex-wrap: wrap; justify-content: center; gap: 20px;">

        <div class="col-sm-3 portal-card" style="border: 1px solid #ddd; padding: 15px; text-align: center; border-radius: 8px; width: 200px;">
            <i class="fa fa-university fa-3x" style="color: #2980b9;"></i>
            <h3>National Library</h3>
            <p>Physical Holdings</p>
            <a href="/cgi-bin/koha/opac-search.pl?limit=branch:NLP" class="btn btn-primary">Browse</a>
        </div>

        <div class="col-sm-3 portal-card" style="border: 1px solid #ddd; padding: 15px; text-align: center; border-radius: 8px; width: 200px;">
            <i class="fa fa-list-alt fa-3x" style="color: #27ae60;"></i>
            <h3>Sher Nowrooz Khan</h3>
            <p>Select Bibliography</p>
            <a href="/cgi-bin/koha/opac-search.pl?limit=branch:SNK" class="btn btn-success">Browse</a>
        </div>

        <div class="col-sm-3 portal-card" style="border: 1px solid #ddd; padding: 15px; text-align: center; border-radius: 8px; width: 200px;">
            <i class="fa fa-graduation-cap fa-3x" style="color: #8e44ad;"></i>
            <h3>Research Theses</h3>
            <p>Academic Papers</p>
            <a href="/cgi-bin/koha/opac-search.pl?q=itype:THESIS" class="btn btn-info" style="background:#8e44ad; border:none;">Explore</a>
        </div>

    </div>
</div>

Step 2: Adding Visual Style (CSS)

To make the cards "pop" and add a professional hover effect, go to Administration > System Preferences > OpacUserCSS and paste the following:

CSS Styles (OpacUserCSS)
/* Sirah Hub Custom Styles */
.portal-card {
    transition: transform 0.3s, box-shadow 0.3s;
    background: #fff;
}
.portal-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-color: #2980b9 !important;
}
.portal-card h3 {
    font-size: 1.1em;
    margin-top: 15px;
    font-weight: bold;
}
.portal-card p {
    font-size: 0.9em;
    color: #666;
}

Step 3: Changing the Logo

Since this is a specialized "Sirah Hub," replacing the generic Koha logo with a custom banner is recommended.

  • Go to Administration > System Preferences > opacsmallimage.
  • Enter the URL of your hub logo (e.g., a calligraphy icon or a custom title).
  • For a larger banner above the search bar, use the opacheader customization in the HTML tool.

Key Tips for Your Layout

  • The "Library" Link: The link /cgi-bin/koha/opac-search.pl?limit=branch:SNK works because the bibliography is treated as a "Library" (Branch). Clicking it filters records specifically to that source.
  • Mobile Friendly: The col-sm-3 and row classes ensure icons stack vertically on mobile devices.
  • Icons: We use FontAwesome (e.g., fa-university). Koha includes this library by default.

Summary Checklist

  • Branches Created: Ensure NLP, SNK, DRS, etc., exist in Library administration.
  • Item Types Created: Ensure THESIS and ARTICLE are set up.
  • HTML Updated: Paste branding code into OpacMainUserBlock.
  • CSS Updated: Add hover effects in OpacUserCSS.

The Architecture of a Research Hub: Libraries vs. Virtual Collections

The Architecture of a Research Hub: Libraries vs. Virtual Collections

The "Virtual Library" Framework: Organizing the National Sirah Hub

In a standard library, a "Branch" is a physical building. In our National Sirah Research Hub, we redefine this. By setting up publishers and major bibliographies as Libraries (Branches) in Koha, we allow researchers to filter results by their original source—transforming a flat list into a multidimensional map of scholarship.

1. Setting Up Sources as "Libraries"

To differentiate between a physical book and a citation from a bibliography, we register the source in Koha Administration > Libraries.

  • Library Code: Use a standardized 3-letter prefix (e.g., DRS for Darussalam, SNK for Sher Nowrooz Khan).
  • Library Name: Enter the descriptive name (e.g., Darussalam Sirah Collection).

2. The Power of "Library" Filtering

This architectural choice provides two major benefits to the end-user:

A. OPAC Faceted Search: Users can use the "Location" filter on the sidebar to instantly see only the virtual records cited by Sher Nowrooz Khan or only the physical holdings of the National Library.
B. Systematic Accessioning: Every item inherits its library code. A citation from the SNK bibliography becomes SNK-0001, making it impossible to confuse a "virtual" record with a physical one.

3. The "Grand Strategy" Roadmap

To manage this project systematically from Day 1, we follow a three-phase execution plan:

Step 1: The Definition Phase

Identify all "Physical Libraries" (IRI, IIUI, NLP) and "Virtual Libraries" (Hamidullah Bibliography, SNK Bibliography). Assign unique codes and finalize MARC frameworks for Books, Articles, and Theses.

Step 2: The Virtual Backbone

Input data from primary bibliographies. Set the Home Library to the bibliography's code (e.g., SNK) and apply a "Not for Loan" status labeled "Virtual Citation" to manage user expectations.

Step 3: The Physical Layering

Harvest data from actual libraries via Z39.50. When a physical match is found, merge the records. Koha retains the rich "Virtual" description while adding a new "Physical" item entry from the holding library.

4. Summary of Hub Data Standards

Material Type Primary MARC Field Home Library Loan Status
Physical Book 952$p (Accession) e.g., NLP Available
Virtual Entry 510 (Citation) e.g., SNK Virtual Citation
Thesis 502 (Degree) e.g., IIUI Reference Only
Article 773 (Host) e.g., IRI Digital/Physical
Management Tip: Create a "One-Point Dashboard" using Koha Reports to track progress. For example: "Show the percentage of SNK Bibliography entries now located in Pakistani libraries."

Cataloging the Sirah Bibliography in Koha

Cataloging the Sher Nowrooz Khan Bibliography in Koha

Bridging Academic Worlds: Cataloging the Sher Nowrooz Khan Bibliography

Integrating entries from Sher Nowrooz Khan’s seminal work, "The Prophet Muhammad (SAW): A Select Bibliography in Western Languages," into your Koha system is a high-value task. This project acts as a "meta-bibliography," where individual entries from the book are transformed into searchable records, creating a bridge between Western scholarship and local accessibility.

1. Cataloging Strategy: "Source" vs. "Subject"

When you extract an entry from this bibliography, you are essentially creating a Virtual Bibliographic Record. You may not physically own the item yet, but its metadata is vital for your "One Point" research hub.

MARC Tag Subfield Purpose
008 Language Set specific language codes (e.g., eng, fre, ger).
500 $a Source Note: Identify the entry as coming from Sher Nowrooz Khan’s bibliography.
510 $a Citation/Reference: Cite the specific entry number (e.g., Entry No. 425).
942 $c Koha Item Type: Set to REF_BIB to indicate it is a citation/reference only.

2. Managing the Entry Workflow

Khan’s bibliography is organized into specialized categories (Biography, Prophethood, Battles, Miracles). To maintain this logic in Koha, map these categories directly to standard Subject Headings (LCSH):

Example Construction for "Miracles" section:

650 #0 $a Muhammad, $c Prophet, $d -632 $x Miracles.
040 ## $a English/Urdu (Cataloging language should suit local users).

3. Visualizing the "One Point" Connection

This method creates a powerful link between scholarly lists and physical availability. If you discover that a Pakistani institution—like the National Library—holds one of these Western-language works, you simply add their 952 (Accession Number) to the pre-existing record. You have already done the heavy lifting of cataloging; now you are simply adding a location.

4. Handling Western Characters (Diacritics)

Western academic works on Sirah frequently use diacritics (e.g., SΔ«rah, MuαΈ₯ammad). To ensure these remain searchable:

  • Encoding: Always verify your Koha instance is using UTF-8 encoding.
  • Search Logic: Modern search engines in Koha (Elasticsearch) handle this natively. A search for "Sirah" will successfully retrieve "SΔ«rah," ensuring your researchers find what they need regardless of specialized characters.

5. Identifying "Physical" vs. "Virtual" Records

For your reporting, it is crucial to distinguish between what you have on the shelf and what you have in the "catalog":

Physical: Books with local accession numbers found in Pakistani libraries.

Virtual: Books cited in the bibliography but not yet located locally. Use a Collection Code (952$c) called SNK_BIB to track these "virtual" entries and monitor your progress in locating them.

How to Install Elastic Search

πŸ“š Why Elasticsearch + Unicode Matters Traditional search engines struggle with: Diacritics (e.g., Ψ²Ψ¨Ψ±، زیر) Word variations Complex scripts...