Giter Site home page Giter Site logo

itemsapi / itemsapi Goto Github PK

View Code? Open in Web Editor NEW
311.0 31.0 53.0 581 KB

Blazingly fast, multi tenant, faceted search API

Home Page: http://itemsapi.com

JavaScript 53.92% Dockerfile 1.76% CSS 2.56% Twig 41.76%
faceted-search enterprise-search search-engine multi-tenant

itemsapi's Introduction

ItemsAPI 2.x - fast faceted search

Blazingly fast faceted search. It has Node.js simplicity and C++ speed.

Features

  • fast faceted search
  • full text search
  • multi-tenancy
  • data indexing
  • pagination
  • simple JSON API
  • web ui for exploring / managing index
  • dockerized with alpine

Performance

ItemsAPI has a great indexing performance. It can index 2M documents in less than 2 minutes on local computer. Searching seems to be 10x faster than Elasticsearch for similar use cases

Docker

docker pull itemsapi/itemsapi:latest
docker run --privileged -it -p 3000:3000 itemsapi/itemsapi

Getting started

Please look into full example here - index and search movies

Licence

ItemsAPI 2.x is created by Mateusz Rzepa. You can use ItemsAPI for free, if your project is Open Source. If you want to use ItemsAPI in to build commercial software, you need to buy a commercial license. Commercial editions can be used in closed source environment. More info soon

itemsapi's People

Contributors

cigolpl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

itemsapi's Issues

System statistics in CLI

Show system information in CLI like in Ionic Framework:

selection_359

For now Node.js and elasticsearch version is enough.

Manage collection from subdomain

User / developer should be able to manage collection / items by subdomain too:
i.e. currently we have POST customdomain.com/api/v1/items/restaurants, additionally it should be managed like POST restaurants.customdomain.com/api/v1/items

(good use case would be for itemsapi working as a service)

Implement range filters based on configurations

For such a configuration

"aggregations": {
  "rating_range": {
    "type": "range",
    "field": "rating",
    "title": "Rating range",
    "ranges": [
      {"lte": 1, "name": "0 - 1"},
      {"gte": 1, "lte": 2, "name": "1 - 2"},
      {"gte": 2, "lte": 3, "name": "2 - 3"},
      {"gte": 3, "lte": 4, "name": "3 - 4"},
      {"gte": 4, "lte": 5, "name": "4 - 5"},
      {"gte": 5, "lte": 6, "name": "5 - 6"},
      {"gte": 6, "lte": 7, "name": "6 - 7"},
      {"gte": 7, "lte": 8, "name": "7 - 8"},
      {"gte": 8, "lte": 9, "name": "8 - 9"},
      {"gte": 9, "name": "9 - 10"}
    ]
  }
}

It should generate range aggregation for the data out of the box.
It will look like this in the dashboard:
selection_346

Docker integration

Tested docker cloud already with another project and works very cool.
Possible integration with amazon aws, digitalocean and even your own server. Project configurable by environment variables i.e. ELASTICSEARCH_URL, PORT etc

Would be great to integrate ItemsAPI with docker - won't be as easy as one-click-to heroku but very flexible though

Get list of all distinct aggregation values

Should return json list with distinct values like:

John Wayne (51)
Michael Caine (51)
Robert De Niro (47)
Bruce Willis (35)
Liam Neeson (33)
Christopher Walken (31)
Samuel L. Jackson (31)
Harvey Keitel (30)

and slugged for pretty url (if slugs option enabled)
john-wayne (51)
michael-caine (51)
samuel-l-jackson (31)

API keys - privileges

Make it possible to access itemsapi data and rest endpoints only by generated API keys.

Consider:

  • one global key (token) for all actions in collection
  • one key for only specific methods like (POST, PUT, DELETE)
  • one key for specific actions (search, create_item, delete_item, get_item, get_collection, etc)

Ignore non elasticsearch properties when saving mapping

elasticsearch > 2.0 is more restricted about non supported schema properties like "display: image"

error: Error: [mapper_parsing_exception] Mapping definition for [actors] has unsupported parameters: [display : array]

Items enabled / disabled

Make option to enable / disable items
Good for items:

  • added by users and waiting for activation process
  • archiving items

Any other suggestions making it more generic very welcome

Make sorting by geo location

It is currently working but for hard coded geo location.

We should:

  • get valid geo location from input
  • make some tests

document details

should take care about:

  • text
  • image
  • gallery
  • geo
  • array (i.e. tags)

Store collections in mongodb

Currently we store collections / configurations in json file. This is good and easy for the start but it is out of sync if backend is growing and we have more server instances.

Probably mongodb could be solution here.

Make data exporting

Make data exporting functionality with access rules which define if collection is exportable or not.

Collection validation

Make collection validator

Ensure:

  • collection is json type (object)
  • name exists and is unique
  • schema, aggregations and sortings is an object type

It can be good start for next improvements i.e. if schema or aggregations fields are correct

Consider using YAML files instead JSON for configurations

YAML seems to be easier and is used in successful frameworks like symfony or ansible.

Check if node.js has good integration with yaml and if it supports importing other yaml files: i.e.:

collections:
- include: collections/movies.yml
- include: collections/songs.yml

Then configuration files would be much easier too read and maybe we should use it.

Refactor collections mapping / configuration

Refactor collections configuration:

  • separate it from /config/root.json
  • store it in database, firstly in json file is enough and make it flexible to store it in redis, mysql or mongodb later
  • write RESTful endpoint for managing configurations (add, edit, delete, list)
  • make async support (it will require code refactor in many places)

Benefits:

  • more scalable because you can store even thousands collections in one application
  • easier management (by dashboard or CLI)
  • easier for writing instalation

Currently it looks like this btw:
selection_347

Discuss overall app structure

This is actually a proposal rather than something to fix, mainly because I haven't dig into the architecture yet, but... the server.js is actually something we can improve in order to allow different backends (like elasticsearch) to be implemented in the future (the main I can think of is a graph database).

For now, we require the services explicitly https://github.com/itemsapi/item/blob/master/server.js#L28-L31 as well as the data and they do depend on each other (e.g. dataService requires some elastic elements - cross-folder requires), so we end up having a nice, not-that-small scope to lookup when handlers are invoked.

Imo, to improve that, we can make something like this:

-- backends
---- elasticsearch
-------db
-------dataService
-------index

and then, do:

app.use(elasticSearch({connectionString}));

ElasticSearch can then create a connection, attach it to request (it's a middleware!) and attach other dataServices to request as well, so in casual request handlers you just write:

router.use(elasticSearch(config));
router.get('/', function(req) {
   req.elastic.dataService(....);
});

All in all, you will end up with a nice layer on top of express that can be just dropped in to any existing app which surely will increase the possible adoption in the future :)

Another thing is the config, imo, with the middlewares pattern presented above, you can just allow user to pass config as an object to your middleware dropping the nconf dependency completely letting users handle the configuration on their own.

After the above are implemented, server.js can be moved to examples/elastic_search/index.js to present one of the possible ways of using the module.

Generate demo collection with CLI

Generate interactive demo collection with command line i.e. for:

  • movies
  • recipes, etc

It would be great for new users because they could create it only in few clicks.
We should inspire by great frameworks like symfony2, meteor, ionicframework.

Create configuration based on items (JSON)

System should be smart enough to create configuration (schema, sortings, aggregations) based on data provided by user / developer

It will significantly decrease learning curve, simplify creating project interface and generally improve user experience

i.e. for

[{
    name: 'Godfather',
    tags: ['Drama', 'Crime fiction'],
    rating: 10
}]

it generates:

{
    "name": "somename",
    "schema": {
        "name": {
            "type": "string",
            "store": true
        },
        "tags": {
            "type": "string",
            "display": "array",
            "index": "not_analyzed",
            "store": true
        },
        "rating": {
            "type": "string",
            "store": true
        },
    },
    "aggregations": {
        "tags": {
            "type": "terms",
            "field": "tags",
            "size": 10,
            "title": "Tags"
        },
    },
    "sortings": {
        "favorites": {
            "title": "Some rating title",
            "type": "normal",
            "order": "desc",
            "field": "rating"
        }
    }
}

Integrations with external providers

Consider collecting data from:

  • google spreadsheet
  • apifier.com
  • google form
  • external json file (url)
  • mongodb / mysql
  • shopify / prestashop / sylius / magento

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.