Comments (5)
From what I know about FTS, I think the change should be definitely made in PG core fts capabilities not just in RUM extension. The reason is that index data can be not enough to know whether tsvector field suits tsquery for complicated queries especially when they contain ! operator. So we sometimes need to recheck with table entry which is done by internal PG fts and so to have RUM in accordance with PG fts capabilities.
It's pity that this supposedly useful capability hasn't got much attention and hasn't been committed. I think this should be the first step and the Rum modification should follow later.
In principle it seems a feasible modification however I may be wrong. The one thing to be considered: in the current tsquery syntax (a & ! b) <-> c means that a and ! b should have the same position in tsvector and it is not equal to (a <-> c) & (! b <-> c) which means possibly two different positions of c in tsvector. So it seems we can not just push down all phrase operators. And it is needed to agree how will logical operators work inside <k,n> operator and how it can be nested itself. Maybe it will be needed a tree instead of simple positions list to be transferred towards the root of query tree in TS_phrase_output().
from rum.
from rum.
FWIW I was able to pretty easily backport this patch into postgres 13 with only very minor modifications. I agree that it should be part of standard, but will have to close this issue for now until it is. Thanks for the replies (and the original patch!)
from rum.
from rum.
FWIW I was able to pretty easily backport this patch into postgres 13 with only very minor modifications. I agree that it should be part of standard, but will have to close this issue for now until it is. Thanks for the replies (and the original patch!)
Yes, I've also taken a look at the patch. Even if it applies and tests are successful my main reason for doubt on it is that it has only tests for simple queries with range operator. And I know from the activity on Tsearch modification in PG13 that main problems were detected anew after several years of tsearch was already in PG in some complicated queries, possibly that ones which have nesting of phrase and logical operators (especially problematic was (!) operator inside other ones). So it definitely needs some elaboration of tests i.e. add complicated queries designed to verify the right implementation of phrase/logical operators nesting. Like select tsvector @@ 'a | (b <1,10> (! c:A & d <1,2> e:C) | f:AB) '::tsquery etc.
The main point of doubt on FTS algebra is that logical operators inside phrase ones are implemented to be not the same as logical operators outside for agglutinative languages support. That needs implementation of range operator to be in accordance, and it may need some limitations for it.
from rum.
Related Issues (20)
- Querying 1.6 million records using RUM index takes 2 seconds HOT 1
- rum compile warnings on pg14.0 HOT 2
- New release with PG14 support HOT 2
- Ошибка: could not load library "/usr/pgsql-14/lib/rum.so" при выполнении create extension HOT 5
- rum_anyarray_addon_ops index not working HOT 1
- Is there a way to weight the rum_ts_score function?
- why the rum index not working HOT 9
- Build failure with PG15: src/rumsort.c:1316:38: error: too many arguments to function ‘LogicalTapeBackspace’ HOT 14
- ERROR: could not load library rum.so: undefined symbol: postgresql_sort__done_semaphore HOT 5
- Hello, may I ask why rum deleted the fast update function, what is the consideration?
- Can we compute two tsvectors like array op?
- New release with PG15 support? HOT 2
- warning on var totalCount compile on mac venture clang
- create rum index without "WITH" cause an error when select use “ORDER BY”
- In a query, `||` does not work when nested in `<->` HOT 3
- Why keyword order doesn't affect rankings? HOT 5
- Can I install it on windows ? HOT 4
- Extension ready for Postgres 14? HOT 2
- [Bug] addInfo is (Datum) 0, which is expected to be not, coredump in func DatumGetByteaP HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rum.