First time here? Check out the FAQ!
2

Is it possible to use Sphinx with Postgres?

Is it possible to use Sphinx with Postgres?

Erick Almeida's avatar
73
Erick Almeida
asked 2012-07-12 13:30:30 -0500
todofixthis's avatar
1.3k
todofixthis
updated 2012-07-12 17:01:04 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

2

Not as it is coded now. Is Sphinx search better than Postgres FTS?

We are adding support of Haystack soon, already have the code on one of the development branches.

Evgeny's avatar
13.2k
Evgeny
answered 2012-07-12 13:37:17 -0500
edit flag offensive 0 remove flag delete link

Comments

I need configure something for search's in Askbot work with Postgres FTS?

Erick Almeida's avatar Erick Almeida (2012-07-12 13:42:46 -0500) edit

No, the configuration for that is built in. If you run migrations FTS will be set up. There is also a management command init_postgresql_full_text_search. If you are bypassing migrations with syncdb --all, then run that command afterwards. The command can be run many times without any issues.

Evgeny's avatar Evgeny (2012-07-12 13:47:31 -0500) edit

How do I run this management command?

Erick Almeida's avatar Erick Almeida (2012-07-12 13:50:22 -0500) edit

python manage.py command_name

Evgeny's avatar Evgeny (2012-07-12 13:51:00 -0500) edit

./manage.py init_postgres_full_text_search This command does't run.

Erick Almeida's avatar Erick Almeida (2012-07-12 13:57:50 -0500) edit

edited my comment - there was typo in the name. all askbot's management commands are listed in the documentation.

Evgeny's avatar Evgeny (2012-07-12 13:59:31 -0500) edit

What typo error? I don't find this command in documentation page. When I try run above command i get this message: Unknown command: 'init_postgres_full_text_search'

Erick Almeida's avatar Erick Almeida (2012-07-12 14:30:07 -0500) edit

I find typing ./manage.py --help (the correctly command is: init_postgresql_full_text_search)

Erick Almeida's avatar Erick Almeida (2012-07-12 14:31:35 -0500) edit

yes, that's it.

Evgeny's avatar Evgeny (2012-07-12 14:38:52 -0500) edit

I have problems with search yet. I have a word "problema" within a question. If I search for this word the system no returns nothing. Do you have any ideia how I can resolve this issue?

Erick Almeida's avatar Erick Almeida (2012-07-12 15:04:19 -0500) edit

Probably because english language is hardcoded, open file askbot/search/postgresql/thread_and_post_models_05222012.plsql and change 'english' to whatever suits you, then rerun the command to refresh the search config and try searching again.

Evgeny's avatar Evgeny (2012-07-12 15:08:45 -0500) edit

If I change this the internal queries of Askbot run correctely?

Erick Almeida's avatar Erick Almeida (2012-07-12 16:23:47 -0500) edit

They will, as long as the language setting is correct. I've tried this with Russian and it worked.

Evgeny's avatar Evgeny (2012-07-12 16:25:04 -0500) edit

I change ts_vector('english') to ts_vector('portuguese'). Then I run "./manage.py init_postgresql_full_text_search". Nothing changes in search.

Erick Almeida's avatar Erick Almeida (2012-07-12 16:29:55 -0500) edit

http://stackoverflow.com/questions/3935941/cannot-get-right-results-from-postgre-full-text-search found this, maybe it will help. I don't know how postgres supports Portugese or how to set it up.

Evgeny's avatar Evgeny (2012-07-12 16:33:03 -0500) edit

It works, now. I change manualy the functions in Postgres. The management command don't update the functions.

Erick Almeida's avatar Erick Almeida (2012-07-12 16:35:24 -0500) edit

Might be useful to compare search engines on a text dump before coding the search backend. This would also be a cool blog post that would get good traffic, to promote askbot.

Joseph's avatar Joseph (2012-07-13 14:59:30 -0500) edit

@Evgeny: Can you provide an indication on when the Haystack code would be added to master? Waiting on this eagerly.

Basel Shishani's avatar Basel Shishani (2012-07-13 22:12:41 -0500) edit
add a comment see more comments