New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

dbc-node-entitysuggest

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dbc-node-entitysuggest

Client for the DBC XP entity suggestion service

latest
Source
npmnpm
Version
2.0.2
Version published
Maintainers
1
Created
Source

dbc-node-entitysuggest

David David

##Client for the DBC entity suggestion service

Implements the suggest method that based on query parameters gives suggestions for continued search.

##How to use:

import * as EntitySuggest from 'dbc-node-entitysuggest';


// Initialize service whit required paramters
const entitySuggest = EntitySuggest.init({
  method: 'entity-suggest',
  endpoint: 'http://xp-p02.dbc.dk',
  port: 8015
});

// make a query to e.g. subject index. This returns a promise.
entitySuggest.getSubjectSuggestions({query: 'display.title', rs: 5})
.then((result) => {
  console.log(result)
});
};

##Methods:

entitySuggest.getSubjectSuggestions({query, rs, hl, hr, n})

  • query: The prefix or word to get subject suggestions for
  • rs: Right searches. Performs additinal right-truncated searches based on a left truncated search. The arguments decides how many of these searches are performed. Performance will go down, when number of searches are increased
  • hl: Highlight-left. If highlight is wanted, both hl and hr must be set. In the returned results the prefix is highlighted with strings provided in hl and hr.
  • hr: Highlight-right. If highlight is wanted, both hl and hr must be set. In the returned results the prefix is highlighted with strings provided in hl and hr.
  • n: Maximum number of returned results. Default is 20
entitySuggest.getSubjectSuggestions({query: 'dan', rs: 5, hl: '_', hr: '_'})
  .then((result) => {
    console.log(result)
  });

entitySuggest.getCreatorSuggestions({query, rs, hl, hr, n})

  • query: The prefix or word to get subject suggestions for
  • hl: Highlight-left. If highlight is wanted, both hl and hr must be set. In the returned results the prefix is highlighted with strings provided in hl and hr.
  • hr: Highlight-right. If highlight is wanted, both hl and hr must be set. In the returned results the prefix is highlighted with strings provided in hl and hr.
  • n: Maximum number of returned results. Default is 20
entitySuggest.getCreatorSuggestions({query: 'lennon', hl: '_', hr: '_'})
  .then((result) => {
    console.log(result)
  });

entitySuggest.getLibrarySuggestions({query, lt, gl, n})

  • query: The prefix or word to get library suggestions for
  • lt: Library-type. If used, the result only contains of libraries of the given type..
  • gl: Geolocation. If set, The suggested libraries are ranked according to their distance to this location.The format is json (example {"lat": 55.5932207, "lng": 11.8575913}).
  • n: Maximum number of returned results. Default is 20
entitySuggest.getLibrarySuggestions({query: 'val', gl: JSON.stringify({lat: 55.5932207, lng: 11.8575913})})
  .then((result) => {
    console.log(result)
  });

FAQs

Package last updated on 05 Feb 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts