3 ms·
I wish someone could fix Postgres's text search to work like SQLite or Solr. I'm teaching myself C in hopes of fixing it, but it ain't easy. Let me define my o
by elchief 11y ago
I wish someone could fix Postgres's text search to work like SQLite or Solr. I'm teaching myself C in hopes of fixing it, but it ain't easy.
Let me define my own lexer as a UDF. Let me define a pipeline of filters like Solr. Let me use BM-25 text similarity like SQLite.
- anarazel 11y ago> Let me define my own lexer as a UDF. You can. CREATE TEXT SEARCH PARSER does essentially that. (Yes, it's called parser, not lexer, but in this case the difference essentially doesn't exist). > Let me define a pipeline of filters like Solr. Hm. Essentially that should be possible using dictionaries. > Let me use BM-25 text similarity like SQLite. Hm. It'll not be possible to write bm25 directly like in sqlite (matching to the current row without specifying it IIUC), but generally it's easy to define additional functions and use them for sorting and whatnot. I think the postgres text search functionality unfortunately has lacked somebody with interest in developing it for a couple years now. It can be useful, but it could be much better. The default text search parser is pretty much useless in my opinion :(
- elchief 11y agoI meant a non-C user defined function. CREATE TEXT SEARCH PARSER requires functions that handle the `internal` type.
- baudehlo 11y agoBeing able to write one in plperl would rock
- karavelov 11y agoYou can create the text search index over the result of arbitrary function. I have done it for a language that lacks stemming/ispell support. In pl/perl.
- e12e 11y agoCould you give a small example to illustrate how/what you mean? Would you make a function that massage tables/views in "StrangeLanguage", and then spits out "StrangeLanguage" that's been stemmed/normalized etc -- and then feed that to pgs normal full text index system?