Skip to content

Add position to documents #95

Description

@chrisreu

I think it would be useful and make sense to add a position to the Documents

This is not necessary for the search itself, but for the front ends that should work with the retrieved Documents.

Consider a front-end that wants to render the Documents position, just like the hunt-server front-end right now. It needs the position data! For the demo i just added two extra fields to the general description.

Having a separate property would allow to write general functions for Document positions.

data Document = Document
  { uri   :: ! URI         -- ^ Unique identifier of the document.
  , desc  :: ! Description -- ^ Description of the document (simple key-value store).
  , wght  :: ! Score       -- ^ Weight used in ranking (default @1.0@).
  , pos   :: ! Maybe Position  -- ^ Optional document position
  }
  deriving (Show, Eq)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions