- Instead of
createSearchIndex(name, options)
you now use the classEasySearch.Index(configuration)
- Instead of
EasySearch.search(name, searchString, options[, callback])
you now use the instance methodindex.search(searchDefinition, configuration)
- Instead of
EasySearch.createSearcher(name, options)
you create inherited classes, e.g. fromEasySearch.Engine(configuration)
collection.initEasySearch
has been removed in favor of instantiating anEasySearch.Index
- All options that were previously passed to
EasySearch.createSearchIndex
are now split up into three levels of configuration: - Engine level configuration, how does the search behave (e.g. sort)
- Index level configuration, which data is searchable and general configuration (e.g. permission)
- Search level configuration, configuration specific to a search (e.g. limit)
let index = new EasySearch.Index({
// index level configuration
collection: myCollection,
engine: new EasySearch.Minimongo({
// engine level configuration
sort : () => ['score']
})
});
index.search('Marie', {
// search level configuration / options
limit: 20,
props: {
'maxScore': 200
}
});
- ES6 / ES2015 is now used in the package code
- Packages have been split up into several packages
easysearch:core
: contains the Javascript APIeasysearch:components
: contains the Blaze Componentseasy:search
: Wrapper package for components and coreeasysearch:elasticsearch
: ElasticSearch engineeasysearch:autosuggest
: Autosuggest componentmatteodem:easy-search
is now deprecated, switch toeasy:search
or one of the sub packages
- Since there are multiple layers of configuration options most of it has changed places or renamed / removed where it made sense
field
=>fields
: index configuratiion, always an array nowcollection
=>collection
: index configurationlimit
=>limit
: search configurationquery
=>selector
andquery
: engine configuration (mongo based engines useselector
now)sort
=>sort
: engine configurationuse
=>engine
: index configuration, is now an instanceof EngineconvertNumbers
=> removed: logic should be configured itselfuseTextIndex
=> removed: It's own engine now (EasySearch.MongoTextIndex
)transform
=>transform
: engine configuration, Now always return a documentreturnFields
=>beforePublish
: engine configuration, A function to return fields that are publishedchangeResults
=> removed: In favor ofbeforePublish
ortransform
props
=>props
: search configurationweights
=>weights
: engine configuration, only forEasySearch.MongoTextIndex
permission
=>permission
: index configuration- No
EasySearch.searchMultiple
anymore, use the index instances themselves to search on multiple indexes - No
changeProperty
,changeLimit
anymore, use theprops
option while using thesearch
method - No
pagination
anymore, use either the components package or implement the pagination logic by usingskip
andlimit
search configuration search
always returns aEasySearch.Cursor
that can be used in a reactive context
- Components are now prefixed with
EasySearch
(e.g.EasySearch.Input
) EasySearch.getComponentInstance
is now split up into two index methodsindex.getComponentDict
: Retrieve search values, (e.g. search string, limit)index.getComponentMethods
: Use search component functionaly (e.g. searching, adding / removing props)
- Not part of core anymore, add
easysearch:elasticsearch
to use body
configuration to change ES body- ElasticSearch client reachable through
index.config.elasticSearchClient
- Not part of core anymore, add
easysearch:autossugest
to use - Uses now
jeremy:selectize
for display logic
There are a lot of new features too, feel free to check them out.