4
2

Could you describe the current state of sphinxfulltext module and its future prospects?

From my understanding it is currently not being integrated into OSQA search plugin system correctly. Here is my perception of the situation:

It looks from the revision history that the sphinxfulltext module was abandoned a long time ago with the last change in the module dating to revision 60. At the same time the pgfulltext module for PostgreSQL is being actively developed with very recent changes to the module.

As the result there seems to be no way at the moment for the sphinxfulltext module handler "question_search" to be called. Originally it was invoked in forum.views.readers.question_search by:

question_search = get_handler('question_search', question_search)
initial = question_search(keywords)

However this plugin setup for search modules was removed in preference to:

@decorate(QuestionManager.search, needs_origin=False)
def question_search(self, keywords):

in the pgfulltext module and then simply:

Question.objects.search(keywords)

in the forum.views.readers.question_search.

Could you please confirm that the above understanding of the situation with regards to sphinxfulltext module not working is correct? If so, is sphinx module going to be fixed in near future?

Would you accept a patch if it was implemented by us? If not, could you indicate if the search module plugin mechanism going to be changed in the future, like it was in the past?

We don't mind implementing the module ourselves, as long as it is not going to become incompatible due to changes in OSQA plugin system one day.

asked 07 Jul '10, 05:01

Yegor%20Guskov's gravatar image

Yegor Guskov
1761410
accept rate: 0%

edited 07 Jul '10, 05:02


The plugin system is itself under active development, but is stabilizing. The sphynx search was developed by someone that is no in the team anymore, and none of the other members are very experienced with sphynx. Also, we had the idea that was not being used anymore. We were also thinking about moving it to a contrib repository.

Any patches and contribed modulea are alwaya welcome :)

link

answered 07 Jul '10, 05:43

Hernani%20Cerqueira's gravatar image

Hernani Cerq... ♦♦
16.8k65975
accept rate: 52%

Here is the little patch that enables the sphinx support for our OSQA deployment.

http://pastebin.com/Ht6VqN3W

It works similar to pgfulltext module by overriding the default QuestionManager.search method. The search supports boolean mode by default.

Please, confirm that you accept this patch into the trunk. Your acceptance of this patch will help us settle down with the search functionality for our website and move on to other features.

Additionally, here is the useful query configuration setting in the /etc/sphinx/sphinx.conf file that enables us to do the full text search on title, body, author, tagnames, comments and answers on the OSQA database.

sql_query = SELECT question.id, question.title, author.username, question.tagnames, question.body, GROUP_CONCAT(answer.body) as answer_bodies FROM forum_node AS question, forum_node AS answer, auth_user AS author WHERE answer.parent_id = question.id AND question.author_id = author.id GROUP BY question.id

Put the above row into the source section of sphinx.conf file.

P.S I have spent some time lately exploring sphinx, so if you want any help from me on this, I will gladly spend my time to explain to anybody how to set it up.

Thank you for your cooperation.

link

answered 07 Jul '10, 20:12

Yegor%20Guskov's gravatar image

Yegor Guskov
1761410
accept rate: 0%

edited 07 Jul '10, 20:15

Thanks a lot. I'll apply your patch and make some adjustments. However, the current database scheme does not have question and answer tables, rather just a single table named node. So I'm guessing here that the sample query configuration will not work anymore right? Could you provide an example of a query adapted to the current schema?

(08 Jul '10, 04:03) Hernani Cerq... ♦♦

The provided query does use the single table "forum_node" indeed. If you look closely at the query, you will spot that "question" and "answer" are just aliases for the same table. These aliases are used to allow for joining the child comments and answers with the parent question item, even though they all reside in the same table.

(08 Jul '10, 04:27) Yegor Guskov
1

Ah, sorry, I was precipitated :) First hours of the day :P

(08 Jul '10, 06:00) Hernani Cerq... ♦♦

@Yegor Guskov. Hi. I have used your sql_query in my setup. I should mention i am new to sphinx and djangosphinx. I think they have been set up correctly as i ran the indexer --config line and it seemed to run ok and said it indexed several documents. also, I created a custom view to use this search method. However, when I go to the url I get this error: connection to localhost:3312 failed ([Errno 111] Connection refused). I have not listed port 3312 anywhere in my .conf file. I'm not sure where its getting that. I even changed the settings.py file for the sphinxfulltext module (although I don't even think that setting is used) Any ideas? Thanks.

(28 Mar '11, 21:14) rsp

@Yegor This is very useful information, Thanks. However I notice that if I use your SQL statement and then search on my index, it will not return any question unless the question has at least one answer. I would also like to include questions that do not yet have answers. I'm not SQL expert. Do you have a suggestion for this? Thanks.

(29 May '11, 23:13) rsp

@Yegor Thanks Yegor, Your patch solved problem with search. But i have small issue, when i try to search something and if it isn't in sphinx's index, i get error "500 Server Error". This is part of log file: ---Cut--- EXCEPTION INFO: ... ... ... File "/usr/lib/pymodules/python2.6/django/db/models/sql/where.py", line 178, in make_atom raise EmptyResultSet EmptyResultSet ---Cut---

Would you can give me an advice how can solve this issue? Thanks for you helping!

(25 Jun '11, 13:05) Akelsey
showing 5 of 6 show 1 more comments
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×144
×56
×4

Asked: 07 Jul '10, 05:01

Seen: 971 times

Last updated: 25 Jun '11, 13:05

powered by OSQA