0

I want to implement PostgreSQL full text search in Django 4.0. for Chinese language. The question already arise in 2010 but there wasn't any suitable solution and they had to move to SQL Server.

In 2015 a PostgreSQL extension for full-text search of Chinese appeared (here). Is it possible to implement that parser using Django? Any reference/pointers on how to do it really appreciated.

user3507584
  • 3,246
  • 5
  • 42
  • 66

1 Answers1

1

A PostgreSQL FTS parser must be written in something which can be compiled to a shared object file. Practically, I think that means either C or C++. Certainly not Django, which is not a programming language at all but rather a framework library.

Now you should be able to install that extension you linked to, then use the extension from Django. That is what extensions are for, they separate the creation from the use.

jjanes
  • 37,812
  • 5
  • 27
  • 34
  • I see, when I look for tutorials, they are related to something else like "Parse PostgreSQL queries in Ruby" or "setup Parse-Server with PostgreSQL on Docker". Where is the parser extension actually installed? In the OS? The linked Github extension install the extesion by `make && make install` but I don't know where is that code run. – user3507584 Feb 12 '23 at 08:19
  • 1
    "Parser" has many different uses, and those other things you mention seem to be for other uses of the word. The FTS parser needs to be installed on the server where the PostgreSQL service runs, in the directories reported by pg_config (but `make` should take care of finding the directories for you). There might be ways to compile on one server and then relocate, but I don't know how to do that. – jjanes Feb 12 '23 at 17:27
  • thanks, at least now I know what I should install and where! – user3507584 Feb 12 '23 at 18:28