firebird icon indicating copy to clipboard operation
firebird copied to clipboard

Extend indexing feature to index multiple values, a little same as word index ..

Open livius2 opened this issue 1 year ago • 2 comments

Currently, when we create an expression index, it must be a singleton function.

For example:

CREATE IXAE_TEST_VALUES ON TEST COMPUTED BY(CALC_SINGLE_VALUE(MY_FIELD));

However, if you need to divide a field into components such as words, numbers, etc., this is not possible.

For instance, consider a field with the value 'My salary is 10000 and it contains 500 for x and 700 for y.' If you need to index each number, or if you have the text 'Lorem ipsum dolor sit amet, consectetur adipiscing elit' and need to index each word, you cannot do this without an external indexer like Lucene, or a helper table and procedure that divides the field into words. It complicate things which is not nescessary at all.

Please add the capability to index multiple values from the same field pointing to the same record.

For example:

CREATE IXAE_TEST_VALUES ON TEST COMPUTED BY(DIVIDE_VALUES_WITH_SUSSPED_PROC(MY_FIELD));

I believe this support is needed as you are planning to introduce JSON, which requires being indexable.

But you must think how to query by this values. Maybe some special word or syntax? Like SELECT * FROM TEST WHERE 'Lorem' IN MY_FIELD

livius2 avatar Jul 16 '24 12:07 livius2

Encouraging denormalization seems like a bad idea to me.

aafemt avatar Jul 16 '24 13:07 aafemt

Encouraging denormalization seems like a bad idea to me.

How will you index JSON in the future? This idea is useful for many scenarios.

livius2 avatar Jul 16 '24 15:07 livius2