Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add File URI as search result option for Strawberryflavor search endpoint #242

Closed
DiegoPino opened this issue Nov 17, 2022 · 1 comment
Closed
Assignees
Labels
enhancement New feature or request Strawberry Flavor Post Processing data extracted that goes into Solr Typed Data and Search

Comments

@DiegoPino
Copy link
Member

See #234
This will also pass a new structure around for the format_strawberryfield work on allowing search to be postprocessed via Metadata Displays and Exposed Metadata Display entities.

Requires (if you want to have a fast service) to add this to your Solr Index, Strawberry Flavor data source

image

The returned JSON structure for a search e.g for an ADO with UUID d7ea33a0-1211-4f05-b733-e4ede4e57624 to the base search path
http://localhost:8001/do/d7ea33a0-1211-4f05-b733-e4ede4e57624/flavorsearch/all/ocr/?q=queen
could be:

{
  "matches": [
    {
      "par": [
        {
          "page": 20,
          "boxes": [
            {
              "l": 0.546,
              "t": 0.148,
              "r": 0.568,
              "b": 0.158,
              "page": 0
            },
            {
              "l": 0.546,
              "t": 0.161,
              "r": 0.568,
              "b": 0.171,
              "page": 0
            },
            {
              "l": 0.389,
              "t": 0.421,
              "r": 0.411,
              "b": 0.431,
              "page": 0
            },
            {
              "l": 0.161,
              "t": 0.347,
              "r": 0.183,
              "b": 0.357,
              "page": 0
            }
          ]
        }
      ],
      "text": "ble metal, lead, copper, glass, wood, paper, &c, 180. {{{Queen}}} Elizabeth, 9. {{{Queen}}} Victoria’s patronage of art, xir; etching, 25; 1,500 proofs(!) of Her portrait, 96; a single impression of a ... ““ Proofs,”” Retouching,” ¢ Publishing,” dis- tinctive titles of ““proofs,” 195; 1,500 proofs (1) of Her Majesty {{{Queen}}} Victoria, 196 ; Rembrandt’s retouchings, 197; poor Miiller and the publisher, fraudulent ... Portraits, fictitious ones, 1x. Poikilographia, 14. Portraits, {{{Queen}}} Elizabeth’s, 9. Portraits, the first printed in England, 9; the first collector of, 15.",
      "sbf_metadata": {
        "sequence_id": "1",
        "file_uuid": "8b7db990-bd5b-4e54-9453-a97cfcd83cd6",
        "sbf_file_uri": "s3://ec1/image-art-exemplar-021-8b7db990-bd5b-4e54-9453-a97cfcd83cd6.jp2"
      }
    },
    {
      "par": [
        {
          "page": 21,
          "boxes": [
            {
              "l": 0.304,
              "t": 0.438,
              "r": 0.32599998,
              "b": 0.44799998,
              "page": 14
            }
          ]
        }
      ],
      "text": "mathematical combinations, the most ex- tensive printing office, 119; William 1V., {{{Queen}}} Victoria, Prince Frederick Wil- liam a ¢ compositor,” the smallest type ever made, 120.",
      "sbf_metadata": {
        "sequence_id": "1",
        "file_uuid": "7103c037-e9d9-4310-a7dd-43efc6375830",
        "sbf_file_uri": "s3://6a9/image-art-exemplar-019-7103c037-e9d9-4310-a7dd-43efc6375830.jp2"
      }
    }
  ]
}

where sbf_metadata is a new key. Does not affect IABookreader at all (is not even aware). Disclaimer: this result was passed through esmero/format_strawberryfield#252. As you can see the original "sequence_id" was 1 for every of these, but then the Twig templating found inside the IIIF Manifest the right Canvas order and rewrote it to page 20 and page 21. This is great.

@DiegoPino DiegoPino self-assigned this Nov 17, 2022
@DiegoPino DiegoPino added enhancement New feature or request Typed Data and Search Strawberry Flavor Post Processing data extracted that goes into Solr labels Nov 17, 2022
@DiegoPino
Copy link
Member Author

Resolved via 266aa68

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Strawberry Flavor Post Processing data extracted that goes into Solr Typed Data and Search
Projects
None yet
Development

No branches or pull requests

1 participant