Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
nxus-searcher
Advanced tools
Readme
The Searcher module enables easy searching of Nxus models using different adapters for Solr, ElasticSearch and others.
> npm install @nxus/searcher --save
The Searcher module depends on @nxus/storage. The first step is adding and configuring the search adapter you'd like to use. For example, if we want to enable ElasticSearch, we first install the waterline-elasticsearch adapter, then setup the configuration options in the Storage config.
npm install waterline-elasticsearch --save
then add to package.json
"storage": { "adapters": { ... "searcher": "waterline-elasticsearch" }, "connections": { ... "searcher: { "adapter": "searcher", "host": ":9200", "log": "warning", "index": "searcher" } } }
Now that the correct Storage adapters are configured, you'll need to tell Searcher which models you want to enable
search using the searchable
method. Searchable accepts an identity for a model which has already been registered.
app.get('searcher').searchable('user')
By default, Searcher will look for a field named title
or name
to use as the search field. You can specify different, or
multiple fields to search by specifying a second options parameter, with the fields
key:
app.get('searcher').searchable('user', {fields: 'firstName'}) app.get('searcher').searchable('user', {fields: ['firstName', 'lastName']})
Based on the model identify, Searcher will create the following routes
/users/search
which accepts a search parameter q
. So to search for the term 'pizza':
/users/search?q=mike
The search wil return a list of results using the views below.
You can provide search specific views to be used for search results:
Alternatively, if no search templates are found, searcher will automatically use the @nxus/base-ui
views for any model
that is searchable (if they exist).
Finally, searcher will use default list/detail views if no other templates are found.
The Search class enables automated searching of models using different adapters.
Register a model to be searchable.
Parameters
FAQs
A search framework for Nxus apps
We found that nxus-searcher demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).