Searching finds items by old name of associated items, disregards updated name

We have a resource template that “forces” users who add new items of a given type to refer to another Omeka S item when filling the field dcterms:provenance.

The following situation emerged:

  • a number of items were created, and they referred to item “x” as provenance
  • users realised they have not written correctly the name of “x”, so they update the name (actually, the title) of “x”. As expected, the new name appears in all items that have “x” as provenance on the related websites
  • users proceed to add new items, and refer to “x” in provenance

All looks good, until people do search.

If they search for the updated name of “x” only the items created after the name change will appear. Even more surpisingly, if I search for the old name of “x” (nowhere to be visibly found in Omeka), all the items that include reference to “x” created before the name change will appear.

This happens both by searching in Omeka S backend, as well as on a site…

Again, reference to “x” appears with the updated and correct name in the website, in the backend, as well as when looking at the public APIs, and the old name is nowhere to be seen. But searching with the old name, shows all items that included reference to “x” before the name of “x” was changed.

Workaround: open all items that were created before the name change of “x” and that included “x” as provenance, and save them again without changing anything. They then appear when searching for the new name of “x” and do not appear any more when searching with the old name of “x”.

In this case it is just a few dozens items and is doable, but I suppose this is not the expected behaviour.

As, so the issue you’re describing is that you had several items linked to an item, and changed the title of that linked-to item, and the search is still bringing up those items as results when searching for the old name (and not the new one).

This is a quirk of how the fulltext search works: to make searching work as expected for linked items, it includes the title of any items being linked to in the searchable “text” of each item. This works fine but does run into an issue when the title of the linked item changes: the “text” for the items that link to it is now out of date. We don’t go and “live” update the text for everything linking to an item when it changes because there could be a really high number of inbound links to an item, too many to update in that way.

What you did works as a workaround. You could also use batch editing to achieve a similar outcome on all the items at once that link to this specific one. Finally, there’s a “reindex” option in site settings that just updates the entire search index for all items, and will catch this.

1 Like

Exactly, you summarised it well.

I have not found the reindex option you mentioned in site settings (nor any indexing-related options in site-specific settings), but I did find an “index for full text-search” option in the global options… ticking it probably triggered a re-index, and looks fine now.

So this still demands a manual intervention from the administrator, but it is an easy and quick one. Thanks for the detailed feedback!

My apologies, I meant to say global settings, not site settings.