Dynamic iFind Index without creating class Index of %iFind.Index.Basic - intersystems-cache

I am trying to make a general purpose text search feature with %iFind.Index.Basic.
According to the iFind Search Tool documentation, an iFind Index must be created in a Class as below:
Class Aviation.TestSQLSrch Extends %Persistent[...]
{
...
Index NarrBasicIdx On (Narrative) As %iFind.Index.Basic(INDEXOPTION=0,
LANGUAGE="en",LOWER=1);
...
}
But this only applies a field in one single class only.
If the iFind search feature needed to be used generally, then a lot of string fields need to be indexed and that is memory consuming and unpractical.
Is there anyway to do iFind indexing dynamically on demand without the need to alter the Class, and still able to be queried with ##Class(%ResultSet)?
In the documentation, it also mentioned Indexing a JSON Object, but without example given. Is this the place I should explored more on?

Using iFind, you first need to create an index and build it before executing any query (nothing dynamically here, as soon as it is index-based).
If you want something more generic, maybe you should use some other Text Analytics options as NLP (Natural Language Processing)

Related

Is it possible to prevent the reading and/or setting of a field value with DBIx Class?

I'm working in a project that uses Catalyst and DBIx::Class.
I have a requirement where, under a certain condition, users should not be able to read or set a specific field in a table (e.g. the last_name field in a list of users that will be presented and may be edited by the user).
Instead of applying the conditional logic to each part of the project where that table field is read or set, risking old or new cases where the logic is missed, is it possible to implement the logic directly in the DBIx::Class based module, to never return or change the value of that field when the condition is met?
I've been trying to find the answer, and I'm still reading, but I'm somewhat new to DBIx::Class and its documentation. Any help would be highly appreciated. Thank you!
I‘d use an around Moose method modifier on the column accessor generated by DBIC.
This won‘t be a real security solution as you can still access data without the Result class, for example when using HashRefInflator.
Same for calling get_column.
Real security would be at the database level with column level security and not allowing the database user used by the application to fetch that field.
Another solution I can think of is an additional Result class for that table that doesn‘t include the column, maybe even defaulting to it and only use the one including the column when the user has a special role.

How to have custom matching logic for action types in a redux-toolkit slice reducer

I want to create a reducer that matches actions using runtime calculated value. The use case is that I'm managing a busy indicator automatically by reference counting actions that end in /pending, etc...
I'm wanting to use redux-toolkit on this new project and I realize I could create a vanilla redux reducer but I'd prefer to keep things consistent if possible. Is there a way to wire up a slice so that it uses a custom match for an action type matching in it's reducer?
After talking with Mark, the creator of redux-toolkit it looks like this feature isn't supported as the goal of the toolkit is optimize the 80+ % use cases and custom action type matching logic is a rare use case.

How do I create a validator for a single collection?

I need to build a custom id validator that will apply to a single collection, whose id will always be pre-defined (won't need a generator).
In the docs about id generators, it's written:
Currently the configuration of the custom generator applies to every resources (buckets, groups, collections, records). This tiny limitation can easily be fixed, don’t hesitate to get in touch with us!
But there is nothing documented about id validation.
So, how do I:
Implement an id validator, that
Will apply to one collection only?
By default cliquet uses a generator which accepts the following regular expression r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$' (All letters and numbers + underscore and "-").
Before you chose to have a different ID validation mechanism, ensure you really need to.
Now, if that's not enough, you would need to select the proper validator depending on some configuration or already existing values, but this is not implemented in cliquet / kinto.
https://github.com/mozilla-services/cliquet/blob/master/cliquet/resource/init.py#L147 is probably a good place to look at / start with.

Is there a way to search for elements that don't have a particular tagged value in Enterprise Architect?

The model search feature is an excellent tool for finding elements throughout a given project. Is there the ability to search for elements that do not have a particular tagged value. For example I want to find all elements that don't have the tagged value property Name.
There's no built-in search for it, and the Search Builder does not allow you to create such a filter. But you could write an SQL search for it.

SOLR/Lucene: How would one go about extending the Scorer class s.t. it could then be wrapped in a Solr plugin

The reason I am asking this, is because extending the Similarity class or using query function is not enough for me. I plan to personalize user queries in terms of their preferences with respect to document fields. I need to update the score of the documents after the text based scoring has been computed using these preferences (which would have been cached by the Solr plugin). Any thoughts?
I'd write a custom function query, it fits your definition of modifying the calculated score with a custom algorithm.