GATEOverflow / question2answer

Question2Answer is a free and open source platform for Q&A sites, running on PHP/MySQL.
http://www.question2answer.org/
GNU General Public License v3.0
0 stars 1 forks source link

Issues regarding Tag search tips #12

Closed shivasagarrao closed 3 years ago

shivasagarrao commented 3 years ago

Search

Screenshot is taken from https://gateoverflow.in/search-tips

Regarding first red box: In GO if there is a space between two tags then it means that there will be two tags in that question or blog. So what does apple tag:"round fruit" do? Does it searches for mentions of apple in either round tag or fruit tag? In above screenshot, explanation you gave was "round fruit" tag. How is "round fruit" tag possible. If there is a space it means two tags right?

Regarding second red box: I think red box should be title:apple

pupi1985 commented 3 years ago

This is a plugin that is not distributed or supported by the Q2A core team. If you require support, then you should follow the steps explained in the plugin wiki.

Regarding the content:apple question, clearly you're right. I will distribute another version of the plugin and update the documentation in the wiki.

Regarding round fruit, you're wrong. That's a perfectly valid tag. Just ask the GO admin to enable Use comma as the only tag separator in the admin/posting section.

Note that page is just a template page. It is distributed with the plugin to ease the documentation process for site owners. They can add and change stuff in it.

pupi1985 commented 3 years ago

Funny thing. I've just realized this was NOT the official Q2A repository :)

arjunsuresh commented 3 years ago

Yes :) it's a fork of Q2A to better keep track of issues and possible pull requests.

"Regarding round fruit, you're wrong. That's a perfectly valid tag. Just ask the GO admin to enable Use comma as the only tag separator in the admin/posting section."

Actually we can't allow space in tags as that's not how the contents are organised. We can edit the documentation as you had suggested but I feel it'll be better to have it in plugin as it's a Q2A option and other users of the plugin can also benefit.

pupi1985 commented 3 years ago

I see the issue: you don't want to branch the plugin too much. If I was in your place, I wouldn't like that either. The thing is that you will have to.

There is a reason why that file is in plain HTML: it needs to be edited by anyone. If I start adding PHP code and querying system settings to dynamically show sections of the file, there will be more people who will prefer not to modify the file. The idea for that file is for everyone to customize it according to their site's needs. There people can replace apple by javascript or round fruit by scripting language.

Furthermore the issue is broader than you are assuming. You thought about single-word tags vs. multi-word tags. The next level will be: tags vs. no tags. The next level would be: amount of characters in the tag greater than a set limit (there's a plugin for that, BTW). I could keep going with view counts.

In conclusion: the file will have to either be developer-ready or human-ready. I need to go for the second one.

arjunsuresh commented 3 years ago

Thanks @pupi1985 . Editing that is not a big deal :+1: Unfortunately I'm not able to raise issue on bitbucket - nothing happens on clicking "Open" (some javascript errors can be seen).

Though not explicitly mentioned in the plugin I can see that multiple tags can be added in search query which sometimes work but sometimes throws this error. Is it expected?

PHP Question2Answer MySQL query error 1062: Duplicate entry '2021-06-05 14:53:06.000-3-search-query=tag:algorithms tag:diffic' for key 'qa_eventlog.datetime_2' - Query: INSERT INTO qa_eventlog (datetime, ipaddress, userid, handle, cookieid, event, params) VALUES (NOW(), ... 'search', 'query=tag:algorithms tag:difficult tag:cormen\tstart=0'), referer: https://gateoverflow.in/search?q=tag%3Aalgorithms+tag%3Adifficult+-tag%3Acormen

pupi1985 commented 3 years ago

Then you might need to fix that datetime_2 index you have added to the original even logger plugin :) https://github.com/q2a/question2answer/blob/947a970beb76168a3ab1f4cbd0af468a168121c6/qa-plugin/event-logger/qa-event-logger.php#L36

arjunsuresh commented 3 years ago

Thanks pupi :) I checked eventlog table and UNIQUE KEYdatetime_2(datetime,userid,event,params(150)), is there and probably I only had added that. But removing that is not the correct solution right - because then we'll have duplicate entries in the eventlog table.

pupi1985 commented 3 years ago

But it makes sense that if you perform the same action twice it appears twice in the eventlog table. Why can't I search twice for the same text and have those 2 searches logged?

arjunsuresh commented 3 years ago

But not at the exact same time (in units of second) right? The above error shows that multiple events are being triggered and probably that's why I had added that unique key.

pupi1985 commented 3 years ago

So what you're saying is that after performing a single search more than one search event is being logged? If that is the case:

  1. I don't think that is the case. I believe there is more than one search being fired
  2. Allowing that second search is an issue with the core
  3. I believe it might be related to clicking on the search button very fast (before the first HTTP search request finishes)
  4. Can you test and confirm if the previous point is right?
arjunsuresh commented 3 years ago

Thank you Pupi. It was actually due to an old service worker which was still active on my browser. Clearing that resolved the issue 🙂

shivasagarrao commented 3 years ago

quotes Screenshot from https://gateoverflow.in/search-tips Quotes can either mean double or single quotes. But if I search using single quotes, tag with special characters are not working. So suggestion is to make sure search works with either single or double quotes.