[PHPBB3-16426] Search settings should allow specification of number of characters to return

Discuss requests for comments/changes posted in the Issue Tracker for the development of phpBB. Current releases are 3.2/Rhea and 3.3/Proteus.
User avatar
P_I
Registered User
Posts: 97
Joined: Fri Oct 31, 2014 4:56 am

[PHPBB3-16426] Search settings should allow specification of number of characters to return

Post by P_I »

I created [PHPBB3-16426] Search settings should allow specification of number of characters to return and have begun investigating and working on providing a fix. But I've come up against a 'design intent' question and I don't know the history of the feature.

Currently on the search.php, the input for the Return first: field is a dropdown list, with a variety of values {-1, 0, 25, 50, 100, 200, 300 ... 1000}. Is there any historical reason this was coded as a dropdown list versus text input with minimum and maximum values?

A secondary question to consider. If something was added to User Control Panel->Board Preferences such as a new 'Edit search settings' vertical tab, what elements of search.php would you want to be able to configure? Personally I'd like to be able to create my own preferences for
  • Search within: - many of my searches are on Topic titles only
  • Display results as: - related to the above, my preference would be Topics
  • Limit results to previous
  • Return first - based on the first two, this isn't meaningful, but I'd probably set it to 'All available', i.e. -1.

User avatar
mrgoldy
Development Team
Development Team
Posts: 64
Joined: Fri Dec 18, 2015 9:41 pm
Location: The Netherlands
Contact:

Re: [PHPBB3-16426] Search settings should allow specification of number of characters to return

Post by mrgoldy »

Not sure if you're familar with git blame, but there you can see the 'history of the code'.
You can click on a line when viewing something on GitHub.
Then by clicking on the dots, you can click 'view git blame'.
https://github.com/phpbb/phpbb/blame/ed ... 1478-L1488

Pretty much that code is ~15 years old, way back, possibly even from the beginning.
With more recent changes you can do some digging into the commits, to which PR and Ticket they belonged to, to find some relative information.

Moreover, about the bug you reported. I was curious what the 0 was for, as -1 already meant 'everything'.
Turns out that breaks even more things, so this is indeed something that is due for a rework.

Problem I personally always have with adding user preferences, is that I feel like overwhelming the end user.
Throwing so many options and possibilities at a user, half of which they don't know what they're for or what they do.
There always are the cases and situations where they are useful for some, but I for one do not see this beneficial to many.

Side effect would be that all those settings would have to be stored again in additional columns in the users table, which already is a gigantic table.
Or a separated table for user preferences should be created, which is a bigger undertaking.
An other possibility would be to allow the admin to specify some defaults for the search page/results in the ACP's Search settings.
That way the admin can already tailor it to the mostly requested and desired options.
phpBB Studio Proud member of the Studio!

User avatar
P_I
Registered User
Posts: 97
Joined: Fri Oct 31, 2014 4:56 am

Re: [PHPBB3-16426] Search settings should allow specification of number of characters to return

Post by P_I »

Thanks. So far my investigate has been using the production code on my local testbed, I hadn't thought to explore GitHub and the source tree.

Returning 0 characters had me wondering too.

BTW, this all started while trying to solve a different problem as discussed in https://www.phpbb.com/community/viewtop ... &t=2547851.

My initial investigation was confined to the ACP Search settings to allow the admin to change the hardcoded default value of 300 to something that might be more appropriate for the board and membership.

EA117 got me thinking about whether or not it should be added to UCP. Of course as you point out the devil is in the details (and database). So although the idea may have merit, the coding changes to implement might suggest the "cost" is too high for a limited number of members who might actually use it.

User avatar
mrgoldy
Development Team
Development Team
Posts: 64
Joined: Fri Dec 18, 2015 9:41 pm
Location: The Netherlands
Contact:

Re: [PHPBB3-16426] Search settings should allow specification of number of characters to return

Post by mrgoldy »

Yeah I followed the discussion and saw the tracker ticket, hooray for email notifications.
And while the code isn't really my biggest concern, if at all, but mostly the overwhelming of a simple user.
I personally always hate when I can't find some simple setting in my account settings somewhere,
because it is obfuscated with random and unnecessary settings only 1% of users actually utilises.

Ofcourse this can be dealt with properly, creating a new, separate module in the UCP with Search preferences or something like that.

I think though that a good starting point would be to make the 'character limit' just a number input and allow an admin to set a default for it.
That way you are also not making major changes to the codebase at this time, while improving functionality.
phpBB Studio Proud member of the Studio!

User avatar
P_I
Registered User
Posts: 97
Joined: Fri Oct 31, 2014 4:56 am

Re: [PHPBB3-16426] Search settings should allow specification of number of characters to return

Post by P_I »

I think we are on the same page and line of thinking.

My expectation is 90+% of software users never bother visiting the preferences section of the software to see how they can configure things to their liking. They are just sheep that accept the whatever defaults are provided and never question any of them.

But because a small percentage of users might want to personalize the experience, they should be offered that opportunity.
mrgoldy wrote:
Thu Apr 09, 2020 11:16 am
I personally always hate when I can't find some simple setting in my account settings somewhere,
because it is obfuscated with random and unnecessary settings only 1% of users actually utilises.
That's poor UI design IMHO. My pet peeve is when something should be configurable by the end-user but I'm stuck with whatever the admin has set. But it is a slippery slope, I too don't want a preferences page that goes on and on and on.

This specific ticket arose because members of a board were confused the search output they were seeing, which lead to discover a value was hardcoded and I couldn't change it. Then I realized that the majority of times I'm searching on a phpBB board, I'm almost always using the Advanced search and I'm changing the Search options to suit my needs.

As you pointed out, the challenge is deciding a) whether this actually needs to be fixed and b) if does get fixed, is it just a ACP fix or does it get warrant UCP changes as well.

User avatar
EA117
Registered User
Posts: 20
Joined: Tue Apr 30, 2019 12:54 pm

Re: [PHPBB3-16426] Search settings should allow specification of number of characters to return

Post by EA117 »

P_I wrote:
Thu Apr 09, 2020 2:39 pm
This specific ticket arose because members of a board were confused the search output they were seeing, which lead to discover a value was hardcoded and I couldn't change it. Then I realized that the majority of times I'm searching on a phpBB board, I'm almost always using the Advanced search and I'm changing the Search options to suit my needs.
Something that comes to mind when you say this, regarding "if the work flow were already very simple, maybe its less of an issue."

If I go to a forum like 3.3.x Support Forum and enter search terms in the "Search this forum..." input field presented there, I'm searching exactly where I want to be searching, but using options I couldn't control the defaults for.

I can hit the "Advanced Search" gear icon instead and thereby see and change anything I want. But now I'm no longer searching just the 3.3.x Support forum either, and must find that forum in the scrolling list of forums and select it, when that's still my intention.

Perhaps we could shave away some of the friction if "the gear icon" -- when invoked from a forum-specific search form -- defaults to searching the same forum that would have been searched if I simply used the input field instead?

So that even if I am "fine with having to select -1 each and every frickin' time" (or whichever default they wish they could configure), we're not adding to that "yeah, we couldn't even be bothered to remember the forum for you, either."

Personally my "vote" would still be for the UCP option, because I'm finding myself wanting the "show entire post" more and more often, since the thing I'm looking for is rarely in the first 300 characters. (Issue of BBCode formatting aside.) But my current workaround to that is to simply add &ch=-1 to the URL after using the "simple" search form to search for what I wanted, rather than ever visiting the Advanced Search form.

User avatar
P_I
Registered User
Posts: 97
Joined: Fri Oct 31, 2014 4:56 am

Re: [PHPBB3-16426] Search settings should allow specification of number of characters to return

Post by P_I »

EA117 wrote:
Thu Apr 09, 2020 4:10 pm
f I go to a forum like 3.3.x Support Forum and enter search terms in the "Search this forum..." input field presented there, I'm searching exactly where I want to be searching, but using options I couldn't control the defaults for.

I can hit the "Advanced Search" gear icon instead and thereby see and change anything I want. But now I'm no longer searching just the 3.3.x Support forum either, and must find that forum in the scrolling list of forums and select it, when that's still my intention.

Perhaps we could shave away some of the friction if "the gear icon" -- when invoked from a forum-specific search form -- defaults to searching the same forum that would have been searched if I simply used the input field instead?
Now that you point that out I would concur is should operate as you've suggested. Perhaps another ticket?

It might be simplest to split this into two work items. First address the ACP side of things and get it integrated into the code base. Then work the UCP side to provide user preferences.
mrgoldy wrote:
Wed Apr 08, 2020 6:04 pm
Pretty much that code is ~15 years old, way back, possibly even from the beginning.
Which is probably why we're having the discussion and looking at the problem with a new perspective on how admins and users might be using the functionality.

Given the limitations of the phpBB search backend, I know many boards add Google search boxes and often members are shocked when I show they things can perform using phpBB's search function. I'd say the most common is the ability to "Search within" - Topic titles only.

User avatar
mrgoldy
Development Team
Development Team
Posts: 64
Joined: Fri Dec 18, 2015 9:41 pm
Location: The Netherlands
Contact:

Re: [PHPBB3-16426] Search settings should allow specification of number of characters to return

Post by mrgoldy »

Well, I've created two PR's for now:
[ticket/16434] Add forum id to advanced search in viewforum
[ticket/16426] Search results return characters as input box

Perhaps you guys want to test them out aswell ;)
phpBB Studio Proud member of the Studio!

User avatar
P_I
Registered User
Posts: 97
Joined: Fri Oct 31, 2014 4:56 am

Re: [PHPBB3-16426] Search settings should allow specification of number of characters to return

Post by P_I »

That was quick. I will most definitely test them out, likely later today or early tomorrow. I'm busy upgrading my boards from phpBB 3.2.9 to 3.3.0 today. Going smoothly so far.

User avatar
P_I
Registered User
Posts: 97
Joined: Fri Oct 31, 2014 4:56 am

Re: [PHPBB3-16426] Search settings should allow specification of number of characters to return

Post by P_I »

mrgoldy wrote:
Sat Apr 11, 2020 8:13 pm
Well, I've created two PR's for now:
[ticket/16434] Add forum id to advanced search in viewforum
Tested on my localhost testbed using a backup of one of my boards. Confirmed it works as expected.
mrgoldy wrote:
Sat Apr 11, 2020 8:13 pm
[ticket/16426] Search results return characters as input box

Perhaps you guys want to test them out aswell ;)
Working the second one, a little more work involved to apply all the changes manually. My testbed setup needs work to connect things to GitHub properly to pull the ticket.

Post Reply