Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

How do you show suggested discussions as users type their questions?

dan33410dan33410 New
edited September 2012 in Vanilla 2.0 - 2.8

Is there a way for users to be prompted about potential answers from previous posts as they are typing their new discussions? I sure hope I described that question right.

Comments

  • ToddTodd Vanilla Staff

    First off, this type of feature will never work if users don't enter descriptive topics. What kind of suggestions do you think you'd get for "how do I do this?" which was your original question title?

    I do believe the new sphinx search plugin has this kind of functionality. You really do need a dedicated search server to be able to process full text searches in real time this way.

  • Thanks for writing back Todd. Actually, Sphinx is perfect for this. I installed it but, whenever I type a new discussion, I get the following error:

    Questions that may already have your answer:
    parsererror (SyntaxError: Unexpected token <)

  • ToddTodd Vanilla Staff

    Maybe the plugin author @mcu_hq can help.

  • Just wrote him. Thanks for your help.

  • mcu_hqmcu_hq ✭✭✭
    edited September 2012

    Like Todd said, a dedicated search engine is the only route. Depending on the amount of users on your site, it could bottle neck your database and cause all sorts of problems using regular MYSQL. My plugin will query sphinx for any related titles. A prospective search of "apples grow on trees" will turn into: "@(title) apples | grow | on | trees" (no quotes).

    For example, here is my query log on my server:

    [Tue Sep 4 12:02:28.650 2012] 0.019 sec [ext2/0/rel 0 (0,20)] [vanilla] [RelatedPost] @(title) appl
    [Tue Sep 4 12:02:29.223 2012] 0.019 sec [ext2/0/rel 0 (0,20)] [vanilla] [RelatedPost] @(title) appl
    [Tue Sep 4 12:02:29.941 2012] 0.012 sec [ext2/0/rel 0 (0,20)] [vanilla] [RelatedPost] @(title) apples
    [Tue Sep 4 12:02:30.021 2012] 0.012 sec [ext2/0/rel 0 (0,20)] [vanilla] [RelatedPost] @(title) apples
    [Tue Sep 4 12:02:30.180 2012] 0.019 sec [ext2/0/rel 0 (0,20)] [vanilla] [RelatedPost] @(title) apples
    [Tue Sep 4 12:02:30.753 2012] 0.019 sec [ext2/0/rel 0 (0,20)] [vanilla] [RelatedPost] @(title) apples | g
    [Tue Sep 4 12:02:34.717 2012] 0.019 sec [ext2/0/rel 0 (0,20)] [vanilla] [RelatedPost] @(title) apples | gr
    [Tue Sep 4 12:02:35.340 2012] 0.023 sec [ext2/0/rel 0 (0,20)] [vanilla] [RelatedPost] @(title) apples | gro
    [Tue Sep 4 12:02:36.011 2012] 0.023 sec [ext2/0/rel 0 (0,20)] [vanilla] [RelatedPost] @(title) apples | grown
    [Tue Sep 4 12:02:36.232 2012] 0.006 sec [ext2/0/rel 0 (0,20)] [vanilla] [RelatedPost] @(title) apples | grown
    [Tue Sep 4 12:02:36.334 2012] 0.013 sec [ext2/0/rel 0 (0,20)] [vanilla] [RelatedPost] @(title) apples | grown
    [Tue Sep 4 12:02:36.864 2012] 0.019 sec [ext2/0/rel 0 (0,20)] [vanilla] [RelatedPost] @(title) apples | grown | on 
    

    not sure why you are getting that error...I PMed u

  • Thanks for writing the regular search works fine. It just keeps displaying this:

    Questions that may already have your answer:
    parsererror (SyntaxError: Unexpected token <)

    Thanks for helping me by the way!

  • mcu_hqmcu_hq ✭✭✭
    edited September 2012

    Is the regular search using sphinx? Go to the plugin Cpanel in your dashboard under 'sphinxsearch' and click on 'query log'. Does that have your potential discussion title listed in there like mine does above?

  • It says:
    An error has occured

  • That error is when I try to display the query log

  • mcu_hqmcu_hq ✭✭✭
    edited September 2012

    oh yea, forgot that the vanilla plugin is different from the github one.

    on this line here

    Change 'Status' to 'Install' and then try again.

    Is the regular search using sphinx and the results are what is expected?

    For debugging, place this line: alert( XMLHttpRequest.responseText); before line 53 in sphinxsearch/widgets/views/relatedpost.php as seen here and tell me what the popup error says.

  • I just did a regular search and it works fine. Also I replaced the old code with the new code from github with the change as mentioned. Still get both errors though.

    First:
    Questions that may already have your answer: parsererror (SyntaxError: Unexpected token <)

    The second error is when I try to look at the query log it says "An error has "occurred"

    Do you think you could jump in and take a look for me if I made you an admin?

  • alright, PM me your admin details..I'll also need FTP access to place a few print_r statements.

  • Looks like you forgot to complete step 3, which writes your config file. Also, you must start searchd for sphinx to do anything.

    You have the same problem that another guy on here had (beny something or other...looks like he deleted his account and all his thread with it). Bascially sphinx keeps getting shutdown after 10 seconds or so. I was able to have it run long enough for me to perform a single query, but then your host shuts the daemon down. You need a host that lets your run a daemon on it. I don't know if sphinx will work with your current setup.

  • Thanks for trying, I really appreciate it. I'll contact my host, but this is so beyond me, I am not even sure what to ask them. What to do you think I should say in order to find out if it can work?

  • I wish benyxxx was still around...not sure if the admins deleted him but the last I heard was that he was looking for a host that would support a daemon running. I don't know if he ever found one. I can guarantee that if you do find one, it will cost more than what you are paying for now and will probably require a dedicated setup.

    If your site does not get too big, you might be able to get away using plain old LIKE in MYSQL and OR all of the words together, but it will not scale well at all!

    First ask if they can setup sphinx for you. The plugin will still work with an existing setup. If they can't setup sphinx for you, then ask if they allow a daemon to run on your server. If yes, ask for a trial or something and then try the plugin once more.

Sign In or Register to comment.