Neophobe Plebeian Mumpsimus
    Wondering what’s next for npm?Check out our public roadmap! »


    2.1.1 • Public • Published

    npm version GitHub tag (latest SemVer) GitHub package.json version NPM monthly downloads GitHub license

    ItemsJS - search engine in javascript

    Full text, faceted, dependency free search engine in javascript. Created to perform fast search on json dataset (up to 100K items).



    (by @darkrubyist)

    See another demo examples

    Use cases

    Itemsjs is being used mostly for data classification of companies, products, publications, documents, jobs or plants

    The solution has been implemented by people from Amazon, Hermes, Apple, Microsoft, James Cook University, Carnegie Mellon University and more. You can find a list of real implementations - here


    • faceted search
    • full text
    • pagination
    • no dependencies (only javascript)
    • working on backend and frontend
    • working with custom full text search

    Getting Started


    npm install itemsjs
    const itemsjs = require('itemsjs')(data, configuration);
    const items =;

    Client side

    or using from the client side:

    npm install itemsjs
    <!-- CDN -->
    <!-- unpkg: use the latest release -->
    <script src=""></script>
    <!-- unpkg: use a specific version -->
    <script src=""></script>
    <!-- jsdelivr: use a specific version -->
    <script src=""></script>
    <!-- locally -->
    <script src="/node_modules/itemsjs/dist/itemsjs.js"></script>
    itemsjs = itemsjs(data, configuration);

    Gulp task:

    function itemjs() {
      return src('node_modules/itemsjs/dist/itemsjs.min.js')
    }; // Will copy to source/javascripts/itemsjs.min.js


    npm install itemsjs
    # download json data
    wget -O data.json

    Create search.js:

    var data = require('./data.json');
    var itemsjs = require('itemsjs')(data, {
      sortings: {
        name_asc: {
          field: 'name',
          order: 'asc'
      aggregations: {
        tags: {
          title: 'Tags',
          size: 10
        actors: {
          title: 'Actors',
          size: 10
        genres: {
          title: 'Genres',
          size: 10
      searchableFields: ['name', 'tags']
     * get filtered list of movies 
    var movies ={
      per_page: 1,
      sort: 'name_asc',
      // full text search
      // query: 'forrest gump',
      filters: {
        tags: ['1980s']
    console.log(JSON.stringify(movies, null, 2));
     * get list of top tags 
    var top_tags = itemsjs.aggregation({
      name: 'tags',
      per_page: 10
    console.log(JSON.stringify(top_tags, null, 2));

    Test that with :

    node search.js


    var itemsjs = ItemsJS(data, [configuration])


    The first data argument is an array of objects.


    Responsible for defining global configuration. Look for full example here - configuration

    • aggregations filters configuration i.e. for tags, actors, colors, etc. Responsible for generating facets.

    • sortings you can configure different sortings like tags_asc, tags_desc with options and later use it with one key.

    • searchableFields an array of searchable fields.

    • native_search_enabled if native full text search is enabled (true | false. It's enabled by default)


    • per_page amount of items per page.

    • page page number - used for pagination.

    • query used for full text search.

    • sort used for sorting. one of sortings key

    • filters filtering items based on specific aggregations i.e. {tags: ['drama' , 'historical']}

    • filter function responsible for items filtering. The way of working is similar to js native filter function. See example

    • isExactSearch set to true if you want to always show exact search matches. See lunr stemmer and lunr stopWordFilter.


    It returns full list of filters for specific aggregation


    • name aggregation name
    • per_page filters per page
    • page page number
    • query used for quering filters. It's not full text search

    itemsjs.similar(id, options)

    It returns similar items to item for given id


    • field field name for computing similarity (i.e. tags, actors, colors)
    • minimum what is the minimum intersection between field of based item and similar item to show them in the result
    • per_page filters per page
    • page page number


    It's used in case you need to reindex the whole data


    An array of objects.


    npm i itemsjs

    DownloadsWeekly Downloads






    Unpacked Size

    367 kB

    Total Files


    Last publish


    • avatar