itemsapi / itemsjs

Extremely fast faceted search engine in JavaScript - lightweight, flexible, and simple to use
Apache License 2.0
350 stars 41 forks source link

for general understanding -index life cycle #32

Closed SergeyRe closed 3 years ago

SergeyRe commented 5 years ago

is it right that idea to generate search index every user session? so we don't keep it precalculated and ready to use in static form?

cigolpl commented 5 years ago

@SergeyRe if you make this precalculation once i.e. in SPA application (i.e. with Vue, React or Angular) or on the backend side then it will be faster. If you don't have so much data i.e. there is less than 1000 items there should not be so much difference in terms of performance.

SergeyRe commented 5 years ago

i think this is a very promising project and perfomance as fn (data size, number and types of facets) is thing for more deep investigation . I see at least 3 ways for expanding "1000 limit" 1.Option to exlude full-text search ( sometimes it is not required feature) 2.Index precalculation 3.Dividing data to smaller parts (with one facet value fixed )

cigolpl commented 5 years ago

@SergeyRe thanks!

Ad. 1) Good idea Ad. 2) Good idea but might be challenging Ad. 3) Not exactly sure what you mean. Maybe caching facets results for first rendering ?

SergeyRe commented 5 years ago

as for p.3 -it is maybe general common sense idea -non specific to your search component If you have data , and searching in fact doing at few different parts -do not combine all data at one massive -make few subsets of data , at least for perfomace reasons. i.e. if your data has user country facet and country of user have to be determed at the beginning of session -better to make special subset of data for every possible country ( not sure -but hope it is clear ) by the way -i know at least one ancient forerunner of your project https://github.com/eikes/facetedsearch i made demo implementation of it here http://roonready.com/ (code is not obfuscated)

cigolpl commented 5 years ago

@SergeyRe ok I see your point now with point 3. Interesting idea. Better performance in cost of more data stored. I think caching also might work well i.e. pre-calculating responses for a popular or all facets. The more facets user chooses the faster it is. If there is no filter chosen and no query made it's the slowest one. I was working once with an app with 5000 items and about 7 different facets. The first filter selection was taking about 2 seconds... I've got more data later and migrated to Elasticsearch

Thanks for an example with your demo and sharing link to another search library. What is in your opinion best thing in ItemsJS in comparison to FacetedSearch ?

SergeyRe commented 5 years ago

the best thing in ItemsJs is that it is live and developing 👍