All Projects → itemsapi → Itemsjs

itemsapi / Itemsjs

Licence: apache-2.0
Full text, faceted, (almost) dependency free search engine in javascript

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Itemsjs

Mailpile
A free & open modern, fast email client with user-friendly encryption and privacy features
Stars: ✭ 8,533 (+4667.04%)
Mutual labels:  search-engine, tags
Search Ui
🔍 A set of UI components to build a fully customized search!
Stars: ✭ 24 (-86.59%)
Mutual labels:  search-engine, filters
fastHistory
A python tool connected to your terminal to store important commands, search them in a fast way and automatically paste them into your terminal
Stars: ✭ 24 (-86.59%)
Mutual labels:  search-engine, tags
Hypertag
Knowledge Management for Humans using Machine Learning & Tags
Stars: ✭ 116 (-35.2%)
Mutual labels:  search-engine, tags
Bm25
A Python implementation of the BM25 ranking function.
Stars: ✭ 159 (-11.17%)
Mutual labels:  search-engine
Awesome Deep Learning Papers For Search Recommendation Advertising
Awesome Deep Learning papers for industrial Search, Recommendation and Advertising. They focus on Embedding, Matching, Ranking (CTR prediction, CVR prediction), Post Ranking, Transfer, Reinforcement Learning, Self-supervised Learning and so on.
Stars: ✭ 136 (-24.02%)
Mutual labels:  search-engine
Ambar
🔍 Ambar: Document Search Engine
Stars: ✭ 1,829 (+921.79%)
Mutual labels:  search-engine
Search Engine Google
🕷 Google client for SERPS
Stars: ✭ 138 (-22.91%)
Mutual labels:  search-engine
Image search engine
Image search engine
Stars: ✭ 177 (-1.12%)
Mutual labels:  search-engine
Photorama
"PHOTORAMA" template for Jekyll
Stars: ✭ 168 (-6.15%)
Mutual labels:  tags
Tis Solr
an enterprise search engine base on Apache Solr
Stars: ✭ 158 (-11.73%)
Mutual labels:  search-engine
Androidcamera
🔥🔥🔥自定义Android相机(仿抖音 TikTok),其中功能包括视频人脸识别贴纸,美颜,分段录制,视频裁剪,视频帧处理,获取视频关键帧,视频旋转,添加滤镜,添加水印,合成Gif到视频,文字转视频,图片转视频,音视频合成,音频变声处理,SoundTouch,Fmod音频处理。 Android camera(imitation Tik Tok), which includes video editor,audio editor,video face recognition stickers, segment recording,video cropping, video frame processing, get the first video frame, key frame, v…
Stars: ✭ 2,112 (+1079.89%)
Mutual labels:  filters
Covid Papers Browser
Browse Covid-19 & SARS-CoV-2 Scientific Papers with Transformers 🦠 📖
Stars: ✭ 161 (-10.06%)
Mutual labels:  search-engine
Jstag
Pure Angular Input Tags project
Stars: ✭ 140 (-21.79%)
Mutual labels:  tags
Rusticsearch
Lightweight Elasticsearch compatible search server.
Stars: ✭ 171 (-4.47%)
Mutual labels:  search-engine
Search
An Open Source Search Engine
Stars: ✭ 139 (-22.35%)
Mutual labels:  search-engine
Gl React Instagramfilters
Instagram filters for gl-react and gl-react-native
Stars: ✭ 157 (-12.29%)
Mutual labels:  filters
React Selectrix
A beautiful, materialized and flexible React Select control
Stars: ✭ 166 (-7.26%)
Mutual labels:  tags
Laravel Meta
HTML Meta Tags management package available for for Laravel 5.*
Stars: ✭ 150 (-16.2%)
Mutual labels:  tags
Drf Url Filters
A django app to apply filters on drf querysets using query params with validations using voluptuous.
Stars: ✭ 150 (-16.2%)
Mutual labels:  filters

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 small json dataset (up to 1000 elements).

Demo

demo

(by @darkrubyist)

See another demo examples

Features

  • faceted search
  • full text
  • pagination
  • no dependencies (only javascript)

Getting Started

NPM

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

Client side

or using from the client side:

npm install itemsjs
<!-- CDN -->
<!-- unpkg: use the latest release -->
<script src="https://unpkg.com/[email protected]/dist/itemsjs.min.js"></script>
<!-- unpkg: use a specific version -->
<script src="https://unpkg.com/[email protected]/dist/itemsjs.min.js"></script>
<!-- jsdelivr: use a specific version -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/itemsjs.min.js"></script>

<!-- locally -->
<script src="/node_modules/itemsjs/dist/itemsjs.js"></script>
itemsjs = itemsjs(data, configuration);
itemsjs.search()

Gulp task:

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

Example

npm install itemsjs

# download json data
wget https://raw.githubusercontent.com/itemsapi/itemsapi-example-data/master/items/movies-processed.json -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 = itemsjs.search({
  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

API

var itemsjs = ItemsJS(data, [configuration])

data

The first data argument is an array of objects.

configuration

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.

itemsjs.search(options)

options

  • 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

  • prefilter function which narrows items down in custom way i.e. with filter or slice. See example

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

itemsjs.aggregation(options)

It returns full list of filters for specific aggregation

options

  • 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

options

  • 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

itemsjs.reindex(data)

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

data

An array of objects.

Credit

  • Lunr.js for providing full text search.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].