0

I'm working with Solr queries that reference items by their short IDs (e.g., 87a46235118d498eb379936701551737). These IDs correspond to my content items in Sitecore.

I often use the Content Editor search bar to find specific items using GUIDs, but when I try to search for items with short IDs, no results appear unless I manually insert the dashes to convert them into the GUID format.

Is there a way to configure Sitecore to handle short IDs directly in the search bar, or is there an alternative method I can use to quickly locate these items without needing to modify the ID format manually?

Short ID Search

search by short ID

GUID Search

search by GUID

2 Answers 2

0

I just tried a couple of searches (Sitecore 10.3) using short IDs and both came back with a hit.

First was bottom right on desktop: Bottom right

Second was main search bar on the content editor:

Top left

The later is obviously the same as your search, which is strange... I get the same result using lowercase letters also.

0

As Dean mentioned, searching by short IDs actually should work. However, an alternative / stopgap solution is a bookmarklet that instantly converts a short ID to a GUID (or vice versa) and copies it to the clipboard for easy pasting:

javascript:(function(){
  let input = prompt("Enter a short ID (e.g. 673b8f8b65188005afa4e660d3a74231) or a GUID (e.g. 673b8f8b-6518-8005-afa4-e660d3a74231):");
  if (!input) return;
  let output;
  if (input.length === 32) {
    output = input.replace(/(.{8})(.{4})(.{4})(.{4})(.{12})/, "$1-$2-$3-$4-$5");
  } else if (input.length === 36 && /^[0-9a-fA-F\-]+$/.test(input)) {
    output = input.replace(/-/g, "");
  } else {
    return;
  }
  let textarea = document.createElement("textarea");
  textarea.value = output;
  document.body.appendChild(textarea);
  textarea.select();
  document.execCommand("copy");
  document.body.removeChild(textarea);
})();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.