Giter VIP home page Giter VIP logo

appbaseio / reactivesearch Goto Github PK

View Code? Open in Web Editor NEW
4.9K 63.0 472.0 361.02 MB

Search UI components for React and Vue

Home Page: https://opensource.appbase.io/reactivesearch

License: Apache License 2.0

JavaScript 53.20% HTML 35.67% Shell 0.05% CSS 6.80% TypeScript 0.33% Vue 3.96%
ui-components data-components react developer-tools search elasticsearch vue react-components vue-components live-demos

reactivesearch's Introduction

reactivesearch
Reactive Search

UI components library for Elasticsearch, OpenSearch, Solr, MongoDB: Available for React and Vue

Read how to build an e-commerce search UI

a.) with React, or b.) with Vue

web vue

Check out Searchbox if you're building search UIs for other JS frameworks, React Native or Flutter.


ReactiveSearch Snapshot Tests npm PRs Welcome Mentioned in Awesome React Mentioned in Awesome Elasticsearch


Check out the ReactiveSearch marketplace at reactiveapps.io.


Banner Image showing all the web UI components we offer

Web designer templates for sketch.

Banner Image showing all the mobile UI components we offer

iOS and Android designer templates for sketch.


TOC

  1. ReactiveSearch: Intro
  2. Features
  3. Component Playground
  4. Live Examples
  5. Comparison with Other Projects
  6. Installation
  7. Docs Manual
  8. Contributing
  9. Other Projects You Might Like

1. ReactiveSearch: Intro

ReactiveSearch is a UI components library for React and Vue, designed to work with ReactiveSearch cloud. It has over 20 UI components consisting of Lists, Ranges, Search UIs, Result displays, AI Answer, Charts, and a way to bring an existing UI component into the library.

A UI component can be used for filtering or searching on the index. For example:

  • A SingleList sensor component applies an exact match filter based on the selected item.
  • A RangeSlider component applies a numeric range query based on the values selected from the UI.
  • A SearchBox component applies a suggestions and search query based on the search term typed by the user.

UI components can be used together (react prop allows configuring this on a per-component level) and render the matching results via a result display UI component.

ReactiveSearch supports the following built-in display components for displaying results (aka hits):

  1. ReactiveList - ReactiveList supports list and card display formats as well as allows custom rendering at both item and component level,
  2. ReactiveMap - ReactiveMap offers choice of Google Maps and OpenStreetMaps for map rendering,
  3. AIAnswer - AIAnswer offers Retrieval Augmented Generation (RAG) via search engine and OpenAI models, and
  4. ReactiveChart - Powered by Apache E-Charts, ReactiveChart offers 5 built-in chart types: pie, bar, histogram, line, scatter, and additional charts in the Apache E-Charts format. ReactiveChart is only supported for React at this time.

2. Features

Design

  • The UI components's query generation and ability to react allows for creating complex UIs where a number of UI components can reactively update based on user interaction.
  • The library handles the transformation of the UI interactions into search intent queries.
  • Comes with scoped and styled components with className`` and innerClass` prop support.
  • Is themable via ThemeProvider.

Ease of Use

๐Ÿ†• ReactiveSearch API: Secure your Search Queries

Starting ReactiveSearch v4 (current major release), the library only sends the search intent, specification for this is here - ReactiveSearch API ref. Based on the choice of search engine you configure in ReactiveSearch cloud, the search query DSL is then generated by ReactiveSearch cloud. This approach is both more secure as well as allows transfering the search business logic on the server-side.

If you're using ReactiveSearch v3 (last major release), use of ReactiveSearch API over ElasticSearch's query DSL is an opt-in feature. You need to set the enableAppbase prop as true in your ReactiveBase component. This assumes that you are using appbase.io for your backend.

We recommend checking out this KitchenSink App that demonstrates the use of the ReactiveSearch API for all the ReactiveSearch components.

โฌ† Back to Top


3. Component Playground

Try the live component playground stories at playground. Look out for the knobs section in the playground part of the stories to tweak each prop and see the effects.


4. Live Demos

A set of live demos inspired by real world apps, built with ReactiveSearch.

Web

You can check all of them on the examples section of website.

โฌ† Back to Top


5. Comparison with Other Projects

Here, we share how ReactiveSearch compares with other projects that have similar aims.

# ReactiveSearch SearchKit InstantSearch
Backend Elasticsearch, OpenSearch, Solr, MongoDB, OpenAI Any Elasticsearch index hosted on any Elasticsearch cluster. Custom-built for Algolia, a proprietary search engine.
Development Actively developed and maintained. Active issue responses, some development and maintenance. Actively developed and maintained.
Onboarding Experience Starter apps, Live interactive tutorial, getting started guide, component playground, every component has a live working demo with codesandbox. Getting started tutorial, no live component demos, sparse reference spec for many components. Starter apps, getting started guide, component playground.
Styling Support Styled and scoped components. No external CSS import required. Rich theming supported as React props. CSS based styles with BEM, not scoped to components. Theming supported with SCSS. CSS based styles, requires external style import. Theming supported by manipulating CSS.
Types of Components Lists, Ranges, Search, Dates, Maps, Result Displays. Can use your own UI components. Lists, Ranges, Search*, Result*. Can't use your own UI components. (Only one component for Search and Result, resulting in more code to be written for customizability) Lists, Range, Search, Result. Can use your own UI components.
Supported Distribution Platforms React, Vue for Web, React Native for mobile. React for Web. React, Vue, Angular, vanilla JS for Web, React Native for mobile but latter has no UI components.

We welcome contributions to this section. If you are building a project or you know of another project that is in the similar space, let us know and we will update the comparisons.

โฌ† Back to Top


6. Installation

Installing ReactiveSearch is just one command.

  • If you're using reactivesearch for React
npm install @appbaseio/reactivesearch

You can check out the quickstart guide with React here.

  • If you're using reactivesearch for Vue
npm install @appbaseio/reactivesearch-vue

You can check out the quickstart guide with Vue here.


7. Docs Manual

The official docs for the React library are at docs.reactivesearch.io/docs/reactivesearch/react.

The components are divided into four sections:

Docs for Vue version of the library are available at docs.reactivesearch.io/docs/reactivesearch/vue.

โฌ† Back to Top


8. Contributing

Please check the contribution guide.


9. Other Projects You Might Like

  • ReactiveSearch API API Gateway for ElasticSearch, OpenSearch, Solr, MongoDB, OpenAI (Out of the box Security, Rate Limit Features, Record Analytics and Request Logs).

  • searchbox A lightweight and performance focused searchbox UI libraries to query and display results with ReactiveSearch Cloud.

  • dejavu Elasticsearch / OpenSearch data viewer and editor

  • appbase-js For when you need to index data in addition to UI components

โฌ† Back to Top

reactivesearch's People

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  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

reactivesearch's Issues

Search Examples: Component Usage

  • Product Hunt search should work on both title and description.
  • Airbnb components should implement react prop between themselves.
  • E-commerce sensor components should implement the react prop between themselves.
  • E-commerce example's category search filter does not show any results on picking a category.
  • Yelp's suggestions seem to be broken.
    While it shows "BARDS TOWN", clicking on it doesn't bring up any results.
  • Meetup's search topics box doesn't show any suggestions. I tried "Big Data", "Single", "Social"

We should implement a noResults view in all examples.

Importantly, we are selling the search functionality and that is broken in some key examples. We need to fix that first.

ResultCard and ResultList components behavior

Result components should wrap the markup with <div>...</div> instead of <a>...</a> when url property is not set.

This is essential for cases when you have <a /> in your title or desc property, because in such cases if the outer wrapper is also an <a> tag, you will end up with nested <a> tags.

New component: RatingsFilter

Component Props

  • componentId String
    component ID.
  • appbaseField String
    DB field to be mapped for the query.
  • title String [optional]
    title of the component, optional.
  • data Object Array
    an array of objects with start, end numeric values and label as either string or HTML.
{[
  {"start": 4, "end": 5, "label": "4 stars and up"}, 
  {"start": 3, "end": 5, "label": "3 stars and up"}, 
  {"start": 1, "end": 5, "label": "> 1 stars"}
]}
  • defaultSelected Object
    pre-selected ratings value, specified with start and end keys, values should match one of the elements in the data array prop.

CSS Styles API

rbc-title-active

For a selected item, there should be a rbc-active class.

Stories

  1. Basic story
  2. With default selected values
  3. with dark theme
  4. Playground.

Create an onboarding experience

Create a 4-step interactive tutorial to guide a user towards building an example ReactiveSearch app.

Step 1: Create App
Step 2: Importer Upload Interface - Upload data, we will provide an example JSON to be directly uploaded
Step 3: Importer + Dejavu View Interface - Provide mappings and view uploaded data
Step 4: Show the final app UI (with an external link to running with codepen)

NestedList: Fix default selection behavior

For defaultSelected prop, only items which are present in the NestedList should be selected and values which are not found in the list should be ignored (Similar to NativeList).

Move playground to it's own repo - reactive-playground

We will move the storybook and associated playground build and config files to its own repo at reactive-playground. That way we can use a unified playground across all reactive* projects.

In doing so, we will also build a jquery-esque plugin to filter stories by applied tags (which can also be set as a URL query parameter)

Reference: appbaseio/reactivebase#78

New component: CategorySearch

An extension of Data Search component meant to be used in e-commerce search settings.

Component Props

  • componentId String
    component ID.
  • appbaseField String
    DB field to be mapped for the query.
  • categoryField String
    DB field path for finding search results by category.
  • title String [optional]
    title of the component, optional.
  • size Number [optional]
    total suggestions to be displayed, defaults to 10.
  • defaultSuggestions Object Array [optional]
    an array of objects with value as string and label as either string or HTML.
{[
  {"value": "breakfast", "label": {<p><i className="fa-icon">Breakfast</p>}}, 
  {"value": "lunch", "label": {<p><i className="fa-icon">Lunch</p>}}, 
  {"value": "dinner", "label": {<p><i className="fa-icon">Dinner</p>}}
]}
  • defaultSelected String [optional]
    pre-selected text by which search should happen.

showSuggestions prop is always set to be true for this component and not exposed in the props spec.

CSS Styles API

rbc-title-active

For a selected item, there should be a rbc-active class.

Stories

  1. Basic story
  2. With default suggestions applied
  3. with dark theme
  4. Playground.

ResultList: Support smaller image sizes

  • onData() method's returning JSON object can have an additional field "image_size", which can take "small" and "large" as valid values. A small value will render the image in an icon size.
  • "desc" field can use styling improvements.

New Component: DynamicRangeSlider

Like RangeSlider but decides its range based on the underlying data, i.e. dynamically.

Component Props

  • componentId String
    component ID.
  • appbaseField String
    DB field to be mapped with UI for querying. Should be numeric.
  • title String
    title of the component, optional.
  • rangeLabels Function [optional]
    takes a function(start_val, end_val) and returns an object in the format:
{
  "start": "start label",
  "end": "end label"
}
  • defaultSelected Function [optional]
    takes a function(start_val, end_val) and returns an object in the format:
{
  "start": 0,
  "end": 10
}
  • showHistogram Boolean
    whether to show the histogram. Defaults to true.
  • stepValue Number
    step value specifies the slider stepper. Value should be an integer between 1 and floor(#total-range/2). Defaults to 1.

CSS Styles API

rbc-histogram-active
rbc-rangelabels-active
rbc-title-active

Stories

  1. Basic story
  2. Story with passing labels via a function
  3. With default selected
  4. With a different step value than 1
  5. In a dark theme
  6. Playground.

New component: TagCloud

Component Props

  • componentId String
    component ID.
  • appbaseField String
    DB field to be mapped for the query.
  • title String [optional]
    title of the component, optional.
  • multiSelect Boolean [optional]
    whether to allow multiple tag selections. Defaults to false.
  • defaultSelected String or Array
    pre-selected values, specified as one of String or Array type. Same validation logic as with ToggleList.
  • showCount Boolean [optional]
    whether to show the count next to the data label. Defaults to false.

Component would be sorted in alphabetical order, and for the time being, will not support any other sort options. The size of the labels will depend on the frequency of their occurrence. Selected label will show a background-color effect.

CSS Styles API

rbc-count-active
rbc-multiselect-active
rbc-title-active

Stories

  1. Basic story
  2. With default Selected values
  3. With multi-select set and default Selected values
  4. with dark theme
  5. Playground.

NestedList: react prop behavior

NestedList component's react prop (i.e. when the NestedList component depends on other components) does not correctly apply to the nested (child) list values.

ResultList: sortOptions prop %@#! with query

When applying sortOptions prop, the resulting query gets sorted on an "undefined" field.

and generates a 400 search parse exception.

The result is a sad list with nothing to show.

can I use this without Appbase?

we are a SaaS startup and have our own search enginge developed. is it possible to use this component without having an appbase account? if so, is there a documentation for it.

NestedList: Support multiple nesting levels

Current implementation of NestedList component supports up to two levels of aggregations. We should implement a generic aggregations query that can support 'n' levels --> and currently limit n to recurse to a depth of 10 (We will wait till the day an actual use-case needs more than that).

New Component: ToggleList

Component Props

  • componentId String
    component ID.
  • appbaseField String
    DB field to be mapped for the query.
  • title String
    title of the component, optional.
  • data Object Array
    an object array of {label:label, value:value} kv pairs, label is displayed in the UI and value is the corresponding actual field value in the database. Note: label can be specified as either String or HTML.
  • multiSelect Boolean
    whether to allow multiple selections, true by default.
  • defaultSelected String or Array
    pre-selected values, specified as one of String or Array type.
  • showCount Boolean
    whether to show the count next to the data label.

CSS Styles API

rbc-count-active
rbc-multiselect-active
rbc-title-active

Stories

  1. Basic story
  2. Story with passing label as a HTML markup
  3. Without title attribute
  4. With default Selected values
  5. In a dark theme
  6. Playground.

New recipe example: Meetup

@metagrover Perhaps while building the meetup example for Reactive Maps, we can build one that can also be re-used here. For the layout, try to keep it closely aligned to the design spec.

Search component: cursor position

Currently, the cursor position doesn't change on the Search components. We need to support cursor movements based on the user inputs.

Possible fix involves working with Reactive-select and applying an event.PreventDefault().

NestedList: Component Update

  • Update the NestedList component to be in sync with ReactiveBase
  • Delete the NestedList component from ReactiveBase.
  • Delete the NestedList story from ReactiveBase.
  • Delete the NestedList story from ReactiveMaps.

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.