Giter VIP home page Giter VIP logo

searchkit / searchkit Goto Github PK

View Code? Open in Web Editor NEW
4.7K 88.0 442.0 86.53 MB

Search UI for Elasticsearch & Opensearch. Compatible with Algolia's Instantsearch and Autocomplete components. React & Vue support

Home Page: http://www.searchkit.co/docs

License: Apache License 2.0

JavaScript 3.69% TypeScript 45.82% CSS 8.85% MDX 38.72% Jupyter Notebook 2.92%
elasticsearch react search ui-components javascript ui nodejs typescript components vue

searchkit's Issues

Introduce purerender utility

we need to add utility to shallowCompare objects and ignore functions except from /component^/i

and provide annotation helpers, perhaps a React.Component subclass too

  • shallowCompare utils
  • annotation/decorator
  • class based
  • unit tests
  • use where appropriate

Error Handling

  • Error states for Hits if error response
  • timeout states

Bug in pagination due to accessors array position

When PageSizeAccessor appears after the PaginationAccessor, the latter will pick up 20 as the page size (because it's 0 before PageSizeAccessor steps in) instead of what's specified in PageSizeAccessor.

In Chrome console, at stack trace:

PaginationAccessor.buildOwnQuery (PaginationAccessor.js:20)
(anonymous function) (Searcher.js:30)
arrayReduce (index.js:1450)
(anonymous function) (index.js:3445)
Searcher.buildQuery (Searcher.js:29)
(anonymous function) (SearcherCollection.js:40)
arrayEach (index.js:1289)
(anonymous function) (index.js:3345)
SearcherCollection.buildQuery (SearcherCollection.js:40)
SearchkitManager.buildQuery (SearchkitManager.js:55)
SearchkitManager._search (SearchkitManager.js:97)
SearchkitManager.performSearch (SearchkitManager.js:85)
Pagination.setPage (Pagination.js:48)
React.cloneElement.onMouseDown (FastClick.js:17)
ReactErrorUtils.invokeGuardedCallback (ReactErrorUtils.js:71)
executeDispatch (EventPluginUtils.js:79)
executeDispatchesInOrder (EventPluginUtils.js:102)
executeDispatchesAndRelease (EventPluginHub.js:43)
executeDispatchesAndReleaseTopLevel (EventPluginHub.js:54)
forEachAccumulated (forEachAccumulated.js:23)
EventPluginHub.processEventQueue (EventPluginHub.js:259)
runEventQueueInBatch (ReactEventEmitterMixin.js:18)
ReactEventEmitterMixin.handleTopLevel (ReactEventEmitterMixin.js:34)
handleTopLevelWithoutPath (ReactEventListener.js:93)
handleTopLevelImpl (ReactEventListener.js:73)
Mixin.perform (Transaction.js:136)
ReactDefaultBatchingStrategy.batchedUpdates (ReactDefaultBat…Strategy.js:62)
batchedUpdates (ReactUpdates.js:94)
ReactEventListener.dispatchEvent (ReactEventListener.js:204)
> this.accessors
> [SearchAccessor, SortingAccessor, FacetAccessor, FacetAccessor, FacetAccessor, FacetAccessor, NumericOptionsAccessor, FacetAccessor, PaginationAccessor, PageSizeAccessor]

and also at that point

> _.reduce(this.accessors, function(query, accessor) { console.log('query page size', query.query.size);return accessor.buildOwnQuery(query);}, query)

gives:

(10 times) query page size 0

Option to not search immediately

  • An option within searchkitManager to not search immediately
  • Will only render results from ES once the user is querying (via searchbox for example
  • initial loading view is shown instead

Caching of queries

Maybe something like this would be enough?

this.cache = {}

if (this.cache[query] !== undefined)
  return this.cache[query]

this.cache[query] = response

Add a Date Filter

I haven't tried fooling around with date fields and the current filters, but date field support could make sense in :

  • Menu (with the possibilité to set the format and filter on just year, or year/month, etc.)
  • Hierarchical Menu (year, then month, etc.)
  • Range Filter

Other possibilities include having a small calendar to pick a date, or 2 to pick a range.

InitialView component

Currently Hits component is responsible for initialView ( view shown when no response have been returned from ES yet )

Should be in its own component like NoHits component.

  • InitialLoading Component
  • Unit tests
  • documentation

Build custom queries

Hi there

First of all thnx for this awesome component!

I still have a few questions that i can't figure out :(
How can i build own custom queries in my React components? For ex. (minified query)

{
  "query": {
    "filtered": {
      "query": {
        "match": {
          "language": "nl-BE"
        }
      },
      "filter": {
        "and": [
          {
            "geo_distance": {
              "distance": "25km",
              ...
            }
          }
        ]
      }
    }
  },
  "sort": [
    {
      "_geo_distance": {
      }
    }
  ]
}

I'm currently looking at the "ImmutableQuery" object that i then assign the the "SearchkitManager" but without any results.

Thnx in advance!

Filter Selected Conditional Component

A component that wraps filter components and shows only when the conditional is satisfied:

 <ShowWhenSelected filterId="type" value="Documents">
   <RefinementFilter ... />
</ShowWhenSelected>

FacetAccessor with different key/field values

The current FacetAccessor passes the same key to build a TermsBucket : TermsBucket(this.key, this.key, ...)
This doesn't allow to have multiple facets using the same field as they'll all share the same bucket key and collide.

An optional aggId option (please find a suitable name...) could be used to allow multiple facets on the same field.

Scroll results to top on pagination change

The current code uses window.scrollTo(0,0), but the demo has a scrolling layout__results.
A "scrollResultsToTop" event should probably be triggered to let the corresponding component react to it.

NumericRefinementListFilter isn't hidden when there are no buckets

Other facets disappear when they have no contents. NumericRefinementListFilter still displays the facet's title. Can be seen in the demo, the "Length" title is displayed while loading the results.

Requires adding a disabled css state link in RefinementListFilter

Pagination pages

  • Show pages as options to select from
  • Unit tests
  • Documentation

Add optional inputs for RangeFilter and NumericRefinementList

Sometimes you want the user to be able to put specific values easily, having inputs helps :
image

This could be a showInputs attribute on RangeFilter and/or NumericRefinementList, but it could also be a nice to have a standalone RangeInputFilter, I guess.

Avoid redondant searches

When moving around the slider in RangeFilter and releasing the slider at the same position it previously was, a new search request is launched.

Searchkit Themes

  • Being able to skin to various themes (material, minimal)
  • Clean up component styles, only basic level layout
  • Better basic default layout

Searchkit can be decoupled from ElasticSearch?

Hi,

I really like how searchkit works, but right now i have some REST api of products that i would like to make a front with searchkit but ElasticSearch is not an option for me.

It can be decoupled from ElasticSearch? or at least "intercept" with some proxy the calls to ElasticSearch to another component that has the Data?

Thanks

componentWillUnmount should remove the accessor

The accessor is added to searchkit on componentWillMount but isn't removed on componentWillUnmount. This prevents from having "dynamic" filter lists with simple/advanced modes that disable/enable filters.

Pagination should use links

Similar to bootstrap's pager, if the pagination buttons were links, you could right-click the link to open the new page in another tab.

SearchBox query throttling doesn't work

When SearchBox's onChange method is called, the following code is used to generate a new search :

            throttle(()=> {
                this.searchQuery(this.accessor.getQueryString())
            }, 400)()

A new throttled searchQuery function is generated each time, so they just stack up without waiting for the 400ms delay. The throttle function should be created in the constructor or in componentWillMount and reused for every call.

Advanced filter type UI for searchkit

Is it possible to create a UI similar to react-redux-test demo where filters can be added based on predefined keywords.

For example,
if the following 3 keywords are defined for searching,

  1. Age
  2. Location
  3. Price

The user will be able to add a new filter below the main search box.

Also, it should support range input for fields like age, price (number field), (ability to show custom input types) when a new filter is added.

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.