emojianlab

Keep Exact Text and Useful Search Keys in an Archive

Preserve display spelling and decide deliberately which differences search can fold.

By David

An archive has a catalogue entry whose title ends in é. A second copy of that title was entered with a separate acute mark. They look the same in ordinary type. An exact match on the raw strings can miss the pair. An overly broad cleanup can lose intentional differences elsewhere. An archive can avoid both problems by keeping the original text and using a documented search key for a specific job.

Give display and lookup a different field

The display title is the name the archive has verified. Keep it in its intended writing system and retain accents and proper spelling. A search key can be a derived value used to retrieve records under a known comparison policy. The title printed on a page need not be rewritten to match every case a search index can understand. Maintain the source and the derived part so a later editor can tell which is which. A search that finds a record still needs a clearly readable title to let the reader choose it.

Choose a stable record ID independently of either title when the system has that ability. People can rename an item or update its display spelling. A permanent ID can continue to refer to the same record. A derived key can change if the search rules change. Treat it as a lookup aid. Do not use equal normalized titles as automatic proof that two records are the same. Titles can be reused for entirely different objects. A written record of the intended matching rules is part of the archive's design.

Test three families of differences

Source pair What can bring them together What to retain
é and e followed by U+0301 A documented NFC comparison The verified source spelling and any representation needed for reference
Wide A and ordinary A A compatibility fold when the field permits it Distinct source values if the written style is meaningful
Latin A and Cyrillic А A separately approved lookup alias if appropriate The identity of each original script

The three cases should not all be fixed with one undocumented replacement list. Canonical normalization can make canonically equivalent sequences match without changing their written accent identity. A compatibility form can fold a wider set of visually or historically related values. An alias can allow users to enter a known alternative term without merging script letters in the core data. Test proposed behavior against actual records. Keep likely near matches distinct where they refer to different things.

Use normalization as one well defined step

Try Unicode Text Normalizer with the composed and decomposed accented title. Compare the exact results with Unicode Text Diff. If they match after NFC then you have evidence about those samples. Define which form the archive uses and apply it to both the stored search key and the incoming query if that is the rule. A mismatch can be caused by normalizing one side only. Keep the exact source in the record so a later review can see which representation was supplied.

Case handling is a separate choice. The useful matching rule can differ by language. Ask which language conventions and examples the archive actually needs. A generic lowercase conversion and a full language aware search are different designs. Record the selected policy and a few test words. Test a change before rebuilding the index. A display title should remain in its chosen case where a reader sees it. Search convenience does not require making all source words look alike.

Plan the review of likely collisions

Suppose an art archive includes a formal title with an enclosed digit and another title with a plain digit. A compatibility fold can make them compare alike. Two related search results can be useful if the visitor can still see both complete titles. An automatic merge could lose a distinct item. Keep separate IDs and visible context such as an edition or creator where those facts are known. A search key can associate them for lookup without making a claim about identity.

Inspect proposed collisions before changing a policy. Sample the records that share a new key. Ask whether the values represent alternate renderings of the same spelling or separate words or tasks. If the search field should be generous and a record field should remain exact then give the two operations their own tests. A strict inventory ID should not suddenly compare through unrelated aliases because the public title search needed a broader match. Keep the behavior tied to the actual purpose of each field.

A query example for a small independent archive

A user searches for Print study and finds several items. The archive can sort or group the results using ordinary metadata such as a date or collection that it actually stores. A combining accent issue may have affected only a title field. Display the actual public name and one verified reference to the item. Let the visitor decide which result they meant. If the search intentionally ignores a compatibility trait then keep the true visual form in the results. A readable result list can make generous matching precise enough for the visitor.

Test exact lookup for the particular record ID using its own rules. Compare an input with a documented leading zero or separator. Verify that the index does not remove it by accident. A broadly advertised search can provide a way to find the item by name while an ID field still preserves its literal value. Think about which of these operations a user is performing whenever a value unexpectedly matches another.

Retain the original through migrations

Before rebuilding search save the current source values in the archive's ordinary repository. Document the transformation applied to derived keys. Check a representative set containing several writing systems if your archive has those records. Include a known collision and a known pair that should match. Inspect the number of results and their original names. Do not rely on a single easy query. A later version should be able to restore or repeat the intended behavior from the original. That makes an index change a reversible decision rather than a rewrite of all records.

When the actual display spelling is corrected document that separately. Keep a record of which source was authoritative and which name changed. Rebuild the relevant derived value and recheck search. If the archive intentionally keeps old names as aliases then annotate the role of each one. The current user should see the correct title. An authorized record history can explain what changed. The two functions can cooperate without hiding changes.

Review search as a reader who knows only the name

Give someone the verified name and ask them to find the entry. Repeat with one documented variant when search is intended to support it. Verify the record they choose rather than stopping at the number of results. If two related items are often confused then improve the visible labels before folding more differences. A smaller exact key can be useful for a technical comparison. A well written result label improves the actual visitor decision.

End the review by saving a small policy note. Include the source field and the derived field and accepted variants. Give one example that should match and one legitimate difference that should remain. Reference the approved record IDs if necessary. This note helps a future editor decide whether a surprising result is caused by normalization or by the way titles were originally entered. It keeps the archive's text both findable and accountable.

Plan a small search migration with two sides of the comparison

An archive owner decides to bring canonically equivalent accented titles together in lookup. Start by choosing a small review set. Include a composed and decomposed title that should be found by the same query. Include two genuine records that share a similar visual spelling but are meant to remain distinct. Record their source titles and stable IDs. Build the proposed comparison in a reversible test copy. Compare each query against the existing results before rewriting anything used by visitors. The review set should show the change the owner asked for and one difference that must survive.

Now try a query typed as the exact display title. Try a version copied from a legacy public entry. The available spelling can change between those paths. The search result should link to a clear label with the correct current display name. If both versions point to the same stored record and no other legitimate record was lost then record that result. A broad query can deliberately list several real records. Confirm that normalizing an input does not cause distinct stored objects to be treated as duplicates.

Explain an alias someone can manage later

A collection may have an ordinary alternate name supplied by its owner. Add it as a named alias where the archive supports aliases. Keep separate evidence showing why it belongs to that record. An alias should not need to become the public display title. It can help a person who searches by an older or translated name. If an alias would match several records then make that ambiguity clear in the result labels. A list of meaningful choices is a better outcome than a hidden merge made by the first matching key.

A transliterated name is one possible search aid when approved. It is a distinct written choice. Canonical normalization does not provide it automatically. Let the person who maintains the record or the authorized reference establish the useful text. Only apply it to the lookup paths for which it is intended. Preserve the archived item in its proper spelling. Test results so a person can find the entry by both the exact title and its legitimate alternative description.

Keep a small record of changes the next editor can repeat

Name the rule and the index field where it applies. Record which existing titles formed your test. Save the policy version with a date if it can change. A later writer can then understand how an old saved query used to behave. Compare actual source strings after the migration. A search rule does not have to rewrite the source. The matching result and the saved display can be tested independently.

If reversed or broader matching is proposed again run the original review set. Check the location of records that are often confused. Reuse the ordinary verified title as the reference visible to the reader. A repair can make lookup more helpful while keeping authors and their writing systems accurately represented. This is what the small separation between an exact source and a useful index allows an archive to maintain.

Tools mentioned

More from Text workflow

Review Plain Text Before You Publish ItCheck the facts and structure and copied values in a real destination.Turn a Chat Export into Useful NotesKeep the source beside an edited copy and preserve the context that still matters.