UIIN-2330 Spike: Investigate adding the Advanced Search component to the Inventory app.

UIIN-2330 - Getting issue details... STATUS

Objective:

Investigate implementing an Advanced search component on the Inventory app that includes:

  • all the Instance search options with the exception of Query search;
  • boolean operator dropdown (AND/OR/NOT);
  • another dropdown that supports the following values: starts with, contains all, contains any, exact match.

Approach:

  • remove Query search from the AdvancedSearch component. It can be passed throw searchOptions property when it is needed;
  • existing Boolean operators can be reused;
  • add a dropdown with precision operators (starts with, contains all, contains any, exact match) to the AdvancedSearchRow component. The precision operator should replace the == comparator if one was chosen (example: Keyword containsAll sun. Instead of Keyword==sun).

Examples of search box structures with precision operators:

  1. Search option - Title (all), search query - sun, precision operator - contains all. Search box structure - title containsAll sun.
  2. Search option - Contributor, search query - Robert, precision operator - starts with, boolean operator - OR, search option - Keyword (title, contributor, ...), search query - chess, precision operator - contains any. Search box structure - contributor startsWith Robert or keyword containsAny chess.
  3. Search option - Instance HRID, search query - inst000000000008, precision operator - exact match, boolean operator - AND, search option - Subject, search query - DVD-ROM. Search box structure - hrid exactMatch inst000000000008 and subject==DVD-ROM.

Changes in modules:

stripes-components

AdvancedSearch

  • remove the Query search, it can be passed through the searchOptions property when needed;
  • add a dropdown with precision operators (starts with, contains all, contains any, exact match);
  • extend the parser (splitIntoRowsRegex) that converts the search string with precision operators.

stripes-smart-components

SearchAndSort

  • nest an existing search to the AdvancedSearch component;
  • add the state of the advanced search modal and the ability to manage it;
  • pass the row state to inventory both on submitting and by clicking the search button in the modal. To be able to utilize advanced search not only in modal mode;
  • add advanced search button;
  • add advanced search reset having clicked the reset button;
  • add the ability to search by clicking Enter key in the modal, when the search button is enabled.

UI-Inventory

  • add "Advanced search" search option in the Instances section;
  • add a query template for all precision operators for each Instance search option besides Query search (see table below);
  • create a row formatter to get a query for each row of the advanced search modal;
  • implement building of query for advanced search and separate it from a regular search;
  • to honor the building of advanced query in facets.

Query templates


regularwith exact matchwith contains allwith contains anywith starts with
Keywordkeyword all "query" or isbn="query" or hrid=="query" or id=="query"keyword==/string "query" or isbn=="query" or hrid=="query" or id=="query"

keyword all "query" or isbn="*query*" or hrid=="*query*" or id=="*query*"

keyword any "query" or isbn="*query*" or hrid=="*query*" or id=="*query*"keyword all "query*" or isbn="query*" or hrid=="query*" or id=="query*"

Contributor

contributors.name="query"

contributors.name==/string "query"

contributors.name= "*query*"

contributors.name= "*query*"

contributors.name="query*"

Title (all)

title all "query"

title==/string "query"

title all "query"

title any "query"

title all "query*"

Identifier (all)

identifiers.value="query" or isbn="query"

identifiers.value=="query" or isbn=="query"

identifiers.value="*query*" or isbn="*query*"

identifiers.value="*query*" or isbn="*query*"

identifiers.value="query*" or isbn="query*"

ISBN

isbn="query"

isbn=="query"

isbn="*query*"

isbn="*query*"

isbn="query*"

ISSN

issn="query"

issn=="query"

issn="*query*"

issn="*query*"

issn="query*"

OCLC number, normalized

oclc="query"

oclc=="query"

oclc="*query*"

oclc="*query*"

oclc="query*"

Instance notes (all)

notes.note all "query" or administrativeNotes all "query"

notes.note==/string "query" or administrativeNotes==/string "query"

notes.note all "query" or administrativeNotes all "query"

notes.note any "query" or administrativeNotes any "query"

notes.note all "query*" or administrativeNotes all "query*"

Instance administrative notes

administrativeNotes all "query"

administrativeNotes==/string "query"

administrativeNotes all "query"

administrativeNotes any "query"

administrativeNotes all "query*"

Subject

if controlled: subjects.value==/string "query" and authorityId=="authorityId"

else: subjects.value==/string "query"

subjects.value==/string "query"

subjects.value all "query"

subjects.value any "query"

subjects.value==/string "query*"

Effective call number (item), shelving order

itemEffectiveShelvingOrder==/string "query"

itemEffectiveShelvingOrder==/string "query"

itemEffectiveShelvingOrder all "query"

itemEffectiveShelvingOrder any "query"

itemEffectiveShelvingOrder==/string "query*"

Instance HRID

hrid=="query"

hrid=="query"

hrid=="*query*"

hrid=="*query*"

hrid=="query*"

Instance UUID

id="query"

id=="query"

id="*query*"

id="*query*"

id="query*"

Authority UUID

authorityId == query

authorityId == query

authorityId=="*query*"

authorityId=="*query*"

authorityId=="query*"

All

cql.all all "query"

cql.all==/string "query"

cql.all all "query"

cql.all any "query"

cql.all all "query*"