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 position to documents #95

Open
chrisreu opened this issue Sep 10, 2014 · 0 comments
Open

Add position to documents #95

chrisreu opened this issue Sep 10, 2014 · 0 comments

Comments

@chrisreu
Copy link
Member

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant