[BS] Similar threads [Deleted]

@021 as per item 4 of the resource standards, you must provide details on the update.

Any resource updates released in the RM should make it clear which issues (if any) have been resolved in the update.


 
  • Like
Reactions: 021
Thanks for the great add-on!

Does the option "Search only in the thread forum" mean searching in the same forum?

Many related threads don't seem to share any words, can I limit the threads that have at least one same word in the titles?

similar-threads.png
 
Last edited:
A thread "What was your first car?" doesn't return any similar threads, but there are many car related discussions.

A thread "Is AARP a good group to join?", none of the similar threads are related. After some browsing, it seems more like a recent thread list, only threads updated in the last few days are used.

result.png
 
Last edited:
Would it be possible to implement this fantastic piece of work when filling out Snog's Advanced Form fields?

For example, I have a set of fields to complete which are then turned into a thread after submit, it'd be awesome if one of these fields (let's say the "Title" field) could display a list of similar threads.

Either way, very nice job :)
 
Does the option "Search only in the thread forum" mean searching in the same forum?
.yes

Many related threads don't seem to share any words, can I limit the threads that have at least one same word in the titles?
The search for similarities is conducted not only by title, but also by message.

-----------------------------------------------------------------

Would it be possible to implement this fantastic piece of work when filling out Snog's Advanced Form fields?
Yes, it can be connected to any fields. You need to specify such attributes for the fields: data-xf-init="st-auto-complete" data-single="true" data-acurl="{{ link('forums/similar-threads', $forum) }}"
CSS and JS must also be connected
Code:
<xf:css src="similar_threads.less" />
<xf:js src="bs/similar_threads/create.js" min="1" />
 
so... was wondering... is there any caching system in place? some threads take a long time to load but next loads are quite fast. this is going to hit the page load speed parameter on google search console badly. thanks for this addon!
 
.yes


The search for similarities is conducted not only by title, but also by message.

-----------------------------------------------------------------


Yes, it can be connected to any fields. You need to specify such attributes for the fields: data-xf-init="st-auto-complete" data-single="true" data-acurl="{{ link('forums/similar-threads', $forum) }}"
CSS and JS must also be connected
Code:
<xf:css src="similar_threads.less" />
<xf:js src="bs/similar_threads/create.js" min="1" />

Thank you so much for your kind reply! How would forum exclusion work in this case? I think the form doesn't pertain to any nodes until the user press the "Submit" button, after which it gets converted into a thread in a specified node.

Thanks again :)
 
How would forum exclusion work in this case? I think the form doesn't pertain to any nodes until the user press the "Submit" button, after which it gets converted into a thread in a specified node.
.can you give a more detailed example? I do not quite understand the question)
 
The "Advanced Form" add-on from Snog makes it possible to compile a list of fields, and then once you submit the template, it creates a new thread in a certain node you define in the add-on settings, I'd like to show similar threads for the same node I defined in the Advanced Form add-on (so that I don't show similar threads forum-wide, but just for that node), so I was wondering if there's a parameter with your add-on in which we can define which nodes to filter the similar threads list.
 
BugReport
  • XF\Db\InvalidQueryException: MySQL query error [1064]: syntax error, unexpected '+', expecting FTS_TERM or FTS_NUMB or '*'
  • src/XF/Db/AbstractStatement.php:228

  • Generiert von: ...
  • 3 Februar 2020 um 17:59

Stack-Trace

SELECT search_index.content_type, search_index.content_id
FROM xf_search_index AS search_index

WHERE MATCH(search_index.title, search_index.message, search_index.metadata) AGAINST ('+** +_md_node_10 -_md_node_190 -_md_node_181 -_md_node_140 -_md_node_14 -_md_node_85 -_md_node_171 -_md_node_128 -_md_node_129 -_md_node_130 -_md_node_131 -_md_node_89 -_md_node_16 -_md_node_82 -_md_node_45 -_md_node_132 -_md_node_27 -_md_node_39 -_md_node_40 -_md_node_41 -_md_node_57 -_md_node_156 -_md_node_91 -_md_node_146 -_md_node_162 -_md_node_137 -_md_node_138 -_md_node_93 -_md_node_97 -_md_node_98 -_md_node_118 -_md_node_94 -_md_node_96 -_md_node_95 -_md_node_99 -_md_node_100 -_md_node_101 -_md_node_102 -_md_node_103 -_md_node_106 -_md_node_108 -_md_node_109 -_md_node_110 -_md_node_111 -_md_node_112 -_md_node_113 -_md_node_114 -_md_node_115 -_md_node_116 -_md_node_107 -_md_node_84 -_md_node_42 -_md_node_44 -_md_node_49 -_md_node_52 -_md_node_133 -_md_hidden_1' IN BOOLEAN MODE) AND search_index.content_type = 'thread'

ORDER BY search_index.item_date DESC
LIMIT 200

------------

#0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL query err...', 1064, '42000')
#1 src/XF/Db/Mysqli/Statement.php(77): XF\Db\Mysqli\Statement->getException('MySQL query err...', 1064, '42000')
#2 src/XF/Db/AbstractAdapter.php(94): XF\Db\Mysqli\Statement->execute()
#3 src/XF/Db/AbstractAdapter.php(160): XF\Db\AbstractAdapter->query('
SELECT sear...', Array)
#4 src/XF/Search/Source/MySqlFt.php(291): XF\Db\AbstractAdapter->fetchAllNum('
SELECT sear...')
#5 src/XF/Search/Search.php(164): XF\Search\Source\MySqlFt->search(Object(XF\Search\Query\Query), 200)
#6 src/XF/Repository/Search.php(34): XF\Search\Search->search(Object(XF\Search\Query\Query))
#7 src/addons/BS/SimilarThreads/Repository/SimilarThreads.php(17): XF\Repository\Search->runSearch(Object(XF\Search\Query\Query))
#8 src/addons/BS/SimilarThreads/XF/Pub/Controller/Forum.php(26): BS\SimilarThreads\Repository\SimilarThreads->getSimilarThreads('**', Object(XF\Entity\Forum))
#9 src/XF/Mvc/Dispatcher.php(350): BS\SimilarThreads\XF\Pub\Controller\Forum->actionSimilarThreads(Object(XF\Mvc\ParameterBag))
#10 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass('XF:Forum', 'SimilarThreads', Object(XF\Mvc\RouteMatch), Object(BS\SimilarThreads\XF\Pub\Controller\Forum), NULL)
#11 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(BS\SimilarThreads\XF\Pub\Controller\Forum), NULL)
#12 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#13 src/XF/App.php(2184): XF\Mvc\Dispatcher->run()
#14 src/XF.php(391): XF\App->run()
#15 index.php(20): XF::runApp('XF\\Pub\\App')
#16 {main}

Status der Anfrage

array(4) {
["url"] => string(178) "/forums/alg-ii.10/similar-threads?q=**&_xfRequestUri=%2Fforums%2Falg-ii.10%2Fpost-thread&_xfWithData=1&_xfToken=1580748703%2C1903a139a6c19fd8db2f334670e34ac1&_xfResponseType=json"
["referrer"] => string(54) "https://www.elo-forum.org/forums/alg-ii.10/post-thread"
["_GET"] => array(5) {
["q"] => string(2) "**"
["_xfRequestUri"] => string(29) "/forums/alg-ii.10/post-thread"
["_xfWithData"] => string(1) "1"
["_xfToken"] => string(43) "1580748703,1903a139a6c19fd8db2f334670e34ac1"
["_xfResponseType"] => string(4) "json"
}
["_POST"] => array(0) {
}
 
  • Like
Reactions: 021
BugReport
  • XF\Db\InvalidQueryException: MySQL query error [1064]: syntax error, unexpected '+', expecting FTS_TERM or FTS_NUMB or '*'
  • src/XF/Db/AbstractStatement.php:228

  • Generiert von: ...
  • 3 Februar 2020 um 17:59

Stack-Trace

SELECT search_index.content_type, search_index.content_id
FROM xf_search_index AS search_index

WHERE MATCH(search_index.title, search_index.message, search_index.metadata) AGAINST ('+** +_md_node_10 -_md_node_190 -_md_node_181 -_md_node_140 -_md_node_14 -_md_node_85 -_md_node_171 -_md_node_128 -_md_node_129 -_md_node_130 -_md_node_131 -_md_node_89 -_md_node_16 -_md_node_82 -_md_node_45 -_md_node_132 -_md_node_27 -_md_node_39 -_md_node_40 -_md_node_41 -_md_node_57 -_md_node_156 -_md_node_91 -_md_node_146 -_md_node_162 -_md_node_137 -_md_node_138 -_md_node_93 -_md_node_97 -_md_node_98 -_md_node_118 -_md_node_94 -_md_node_96 -_md_node_95 -_md_node_99 -_md_node_100 -_md_node_101 -_md_node_102 -_md_node_103 -_md_node_106 -_md_node_108 -_md_node_109 -_md_node_110 -_md_node_111 -_md_node_112 -_md_node_113 -_md_node_114 -_md_node_115 -_md_node_116 -_md_node_107 -_md_node_84 -_md_node_42 -_md_node_44 -_md_node_49 -_md_node_52 -_md_node_133 -_md_hidden_1' IN BOOLEAN MODE) AND search_index.content_type = 'thread'

ORDER BY search_index.item_date DESC
LIMIT 200

------------

#0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL query err...', 1064, '42000')
#1 src/XF/Db/Mysqli/Statement.php(77): XF\Db\Mysqli\Statement->getException('MySQL query err...', 1064, '42000')
#2 src/XF/Db/AbstractAdapter.php(94): XF\Db\Mysqli\Statement->execute()
#3 src/XF/Db/AbstractAdapter.php(160): XF\Db\AbstractAdapter->query('
SELECT sear...', Array)
#4 src/XF/Search/Source/MySqlFt.php(291): XF\Db\AbstractAdapter->fetchAllNum('
SELECT sear...')
#5 src/XF/Search/Search.php(164): XF\Search\Source\MySqlFt->search(Object(XF\Search\Query\Query), 200)
#6 src/XF/Repository/Search.php(34): XF\Search\Search->search(Object(XF\Search\Query\Query))
#7 src/addons/BS/SimilarThreads/Repository/SimilarThreads.php(17): XF\Repository\Search->runSearch(Object(XF\Search\Query\Query))
#8 src/addons/BS/SimilarThreads/XF/Pub/Controller/Forum.php(26): BS\SimilarThreads\Repository\SimilarThreads->getSimilarThreads('**', Object(XF\Entity\Forum))
#9 src/XF/Mvc/Dispatcher.php(350): BS\SimilarThreads\XF\Pub\Controller\Forum->actionSimilarThreads(Object(XF\Mvc\ParameterBag))
#10 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass('XF:Forum', 'SimilarThreads', Object(XF\Mvc\RouteMatch), Object(BS\SimilarThreads\XF\Pub\Controller\Forum), NULL)
#11 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(BS\SimilarThreads\XF\Pub\Controller\Forum), NULL)
#12 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#13 src/XF/App.php(2184): XF\Mvc\Dispatcher->run()
#14 src/XF.php(391): XF\App->run()
#15 index.php(20): XF::runApp('XF\\Pub\\App')
#16 {main}

Status der Anfrage

array(4) {
["url"] => string(178) "/forums/alg-ii.10/similar-threads?q=**&_xfRequestUri=%2Fforums%2Falg-ii.10%2Fpost-thread&_xfWithData=1&_xfToken=1580748703%2C1903a139a6c19fd8db2f334670e34ac1&_xfResponseType=json"
["referrer"] => string(54) "https://www.elo-forum.org/forums/alg-ii.10/post-thread"
["_GET"] => array(5) {
["q"] => string(2) "**"
["_xfRequestUri"] => string(29) "/forums/alg-ii.10/post-thread"
["_xfWithData"] => string(1) "1"
["_xfToken"] => string(43) "1580748703,1903a139a6c19fd8db2f334670e34ac1"
["_xfResponseType"] => string(4) "json"
}
["_POST"] => array(0) {
}
.this error is present on your forum and during the usual search on the forum, if you look for "*********". Try updating MySql or creating a bug report here https://xenforo.com/community/forums/bugs/
 
is there an option to manually edit a thread and add similar threads? ive installed the plugin its picked up some but some are totally not related to the thread its linked to, is there any way this plugin could be customized a little bit?
 
Top Bottom