Hackathon2019

<back to all web services

DocumentSearchRequest

Requires Authentication
The following routes are available for this service:
GET,POST/api/documentsearch/{TopDestination}Search within a document
DocumentSearchRequest Parameters:
NameParameterData TypeRequiredDescription
TopDestinationpathstringYesThe document id to search within
SearchRequestBase Parameters:
NameParameterData TypeRequiredDescription
QueryformstringNoThe query string to search for. Enable phrase search using " around the searchphrase. Otherwise a AND'ed termbased search is used
Rowsformint?NoNumber of rows to return
OffsetformintNoNumber of rows to skip. Use for pagination scenarios
SortBysformList<SortByField>NoSortBys to sort the result. Defaults to Relevance
SortByField Enum:
NameValue
Relevance0
DestinationNameAsc1
DestinationNameDesc2
SourceIdAsc3
SourceIdDesc4
SourceNameAsc5
SourceNameDesc6
SequenceAsc9
SequenceDesc10
DocumentSearchResponse Parameters:
NameParameterData TypeRequiredDescription
HitItemsformList<HitItemDto>NoList of hits within the document based on subdocument ids
TotalNumberOfHitsformintNoTotal number of hits. Useful in pagination scenarios
MatchingTokensformList<string>NoList of matching tokens returned in the search result
HitItemDto Parameters:
NameParameterData TypeRequiredDescription
IdformstringNoThe document id. Also known as TopDestination
SourceNameformstringNoThe source name
SourceIdformintNoThe source id. Can be used as a filtered query
TitleformstringNoThe document title
ShortTitleformstringNoThe document short title (if any)
ScoreformdoubleNoThe searches relevance score
StatusformstringNoThe documents legal status

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /api/documentsearch/{TopDestination} HTTP/1.1 
Host: hackathon2019.rettsdata.no 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<DocumentSearchRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Bff.Dto.Search">
  <Offset>0</Offset>
  <Query>String</Query>
  <Rows>0</Rows>
  <SortBys>
    <SortByField>Relevance</SortByField>
  </SortBys>
  <TopDestination>String</TopDestination>
</DocumentSearchRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<DocumentSearchResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Bff.Dto.Search">
  <HitItems>
    <HitItemDto>
      <Id>String</Id>
      <Score>0</Score>
      <ShortTitle>String</ShortTitle>
      <SourceId>0</SourceId>
      <SourceName>String</SourceName>
      <Status>String</Status>
      <Title>String</Title>
    </HitItemDto>
  </HitItems>
  <MatchingTokens xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>String</d2p1:string>
  </MatchingTokens>
  <TotalNumberOfHits>0</TotalNumberOfHits>
</DocumentSearchResponse>