HachetteUK / HUK-API

Hachette UK API
1 stars 0 forks source link

Search Parameters - Title & Author #1

Open duncangroberts opened 6 years ago

duncangroberts commented 6 years ago

Is your feature request related to a problem? Please describe. Currently it is only possible to enter ISBN as a search parameter. This leads to users having to know the exact ISBN in order to return a result in an API call

Describe the solution you'd like It would be useful if, at the very least, author and title were parameters to search on. For example, searching for an author's name would return all records for that author. Searching for a title would be similar to the ISBN search. Useful to have fuzzy logic on the title search to mitigate exclusions of "the", "a" etc.

Describe alternatives you've considered In future, subject classifications and other criteria could be added, as well as the option to add multiple parameters to further narrow down results.

Additional context

garfbradaz commented 6 years ago

@duncangroberts

API is now under design, We use Swagger for this, so when I have a draft specification I will share here.

garfbradaz commented 6 years ago

@duncangroberts

Ive made a start if the Title Search API design. I think we can have separate Author search so that we can keep the methods as specific as possible and reduce latency. I have also included filters by Imprint and Division and paging functionality.

To begin with the method sigature for Titles is:

/products/search/{title}:
    get:
      tags:
        - search
      summary: Search for a Product using its Title.
      description: |
        Gets `product` search objects.
      produces:
        - application/json
      parameters:
        - 
          name: title
          in: path
          description: Title to search with.
          required: true
          type: string
        -
          name: filterByImprints
          in: query
          description: Filters products with one of these Imprints.
          required: false
          type: array
          collectionFormat: multi
          items:
            type: string
        -
          name: filterByDivisions
          in: query
          description: Filters products with one of these Divisions.
          required: false
          type: array
          collectionFormat: multi
          items:
            type: string
        -
          name: limit
          in: query
          description: Size of collection to be returned.
          required: false
          type: number
          format: integer
          default: 20
          minimum: 1
          maximum: 999
        -
          name: page
          in: query
          description: Page number you wish returned.
          required: false
          type: number        
        - name: fuzzy
          in: query
          description: Use Fuzzy Search for Title
          required: false
          type: boolean

The documentation is here

I will move on to Author Search.