Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

As of Orchid, searching for instance records by searching on MARC values must be done through an API query, using a tool like Postman (Getting started with Postman) or writing your own search scripts.

...

To use the MARC Search Query API, POST your request to the source-storage/stream/marc-record-identifiers endpoint.

For example: https://folio-testing-okapi.dev.folio.org/source-storage/stream/marc-record-identifiers You must include the usual Okapi headers including your tenant and token.

Queries submitted to this endpoint will return the UUIDs for the instances related to the SRS MARC records that matched your search criteria.

Developer documentation: https://s3.amazonaws.com/foliodocs/api/mod-source-record-storage/p/source-record-storage-stream.html#source_storage_stream_marc_record_identifiers_post

Boolean limitation - while you can use and/or within the fields search or with the leader search, you cannot combine leader and field search.*

*as of Orchid-SP-6++ release, you CAN combine the search keys e.g.  

...

To search data fields with a left anchored search, identify the tag, follow it with a dot, followed by the subfield. For instance to search the 260$a for 'Paris', use the expression:

{
"fieldsSearchExpression": "260.a ^= 'Paris'"
}

To search the 600$2 for 'fast' use:

{
"fieldsSearchExpression": "600.2 ^= 'fast'"
}

To search a field without subfield e.g. 001

{
"fieldsSearchExpression": "001.value = 'in01234567890'"

}

Search indicators

{
  "fieldsSearchExpression": "856.ind2 =  '0'"
}

...

To search the 005 for '2021' at beginning at position 0 use this expression:

{
"fieldsSearchExpression": "005.00_04 = '2021'"
}

To search the 008 field at position 06 for 's' use this expression:

{
"fieldsSearchExpression": "008.06_01 = 's'"
}


Search the leader

To search the leader, specify the position you wish to search. For example to search for 'a' in position 06 and 'm' in position 07, use the expression:

{
"leaderSearchExpression": "p_06 = 'a' and p_07 = 'm'"
}


Check for the presence of a MARC tag

...

"fieldsSearchExpression": "245.value is 'absent'"    

}

Search dates

* 005.date = '20141107' - only single date equality
* 005.date not= '20141107' - not equals
* 005.date from '20141106' - from the given date to now
* 005.date to '20141108' - to the beginning of time to the given date
* 005.date in '20141106-20141108' - the given date is in the date range

this probably only works with a "date field" (yyyymmddhhmmss.f) in MARC e.g. https://www.loc.gov/marc/bibliographic/bd005.html. Doesn't work with tag that happens to have yyyymmdd in a subfield e.g. https://www.loc.gov/marc/bibliographic/bd033.html

Operators

BOOLEAN_OPERATOR_AND("and"),

...

QueryDescription

{"fieldsSearchExpression": "856.u = 'http://proxy.library.cornell.edu/login?url='"}

We use this search to look for records where someone added the proxy but not the rest of the url

{"fieldsSearchExpression": "008.35_03 = 'bur' and 880.value is 'absent'"}

Burmese materials that do not have 880s
{
    "leaderSearchExpression": "(p_05 = 'a' and p_06 = 'b') or (p_07 = '1' and p_08 = '2')",
    "fieldsSearchExpression": "(035.a = '(OCoLC)63611770' and 036.ind1 = '1') or (245.a ^= 'Semantic web' and 005.value ^= '20141107')",
    "suppressFromDiscovery": false,
    "deleted": false,
    "offset": 0,
    "limit": 10
}
a little more complex example, notice we can paginate and etc.

...

  • there's NO whole tag search (must search for a specific tag/indicator) e.g. you CANNOT do
    • "fieldsSearchExpression": "245 = 'Gulp'"
    • "fieldsSearchExpression": "245.value ^= 'Gulp'" will returns you something but the count is different (a little bit higher) from "fieldsSearchExpression": "245.a ^= 'Gulp'"

      • not sure what it's actually doing
  • the = operator
    • means exact match e.g.
    • "245.a ^= 'Gulp'"
      • match
    • "245.a = 'Gulp'"
      • not match
      "245.a = 'Gulp : '"
      • not match (notice the trailing space after semi-colon, it trims() when index)
    • "245.a = 'Gulp :'"
      •  match

technical stuff

...