Changes to search

Broken link? Feature request? Anything related to the Spectrum Computing website here.
User avatar
PeterJ
Site Admin
Posts: 6873
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Changes to search

Post by PeterJ »

Following some potential issues with search identified by [mention]StooB[/mention], we are making some small changes.

Previously you had to enter at least 3 characters in a search box (any characters including special characters). This has now changed to at least three alphanumeric characters. So from now on:

*** - Not accepted
D?? - Not accepted
Dizzy* - OK

At the moment this is only implemented in the main multi search entry box on the top right of the home page. I will implement it in all the advanced search fields in the next few days.

Please test and feedback here.
User avatar
R-Tape
Site Admin
Posts: 6402
Joined: Thu Nov 09, 2017 11:46 am

Re: Changes to search

Post by R-Tape »

Ta!

Is there any way that e.g. "3D" could be a viable search?
User avatar
djnzx48
Manic Miner
Posts: 730
Joined: Wed Dec 06, 2017 2:13 am
Location: New Zealand

Re: Changes to search

Post by djnzx48 »

Doesn't this prevent non-English language searches from working? For example, try searching for "ńńńńń" and it says you need "at least 3 alphanumeric characters".
User avatar
PeterJ
Site Admin
Posts: 6873
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: Changes to search

Post by PeterJ »

Search is one of the most challenging areas especially when you are looking at non UK character sets as well. I'm very happy to share our code with any developers out there.

It may be possible to allow a small number of 2 character exceptions to the rule such as '3D'

This is what we are using, and we are trying to avoid allowing search returning huge numbers of rows:

https://www.php.net/manual/en/book.ctype.php

Peter
User avatar
djnzx48
Manic Miner
Posts: 730
Joined: Wed Dec 06, 2017 2:13 am
Location: New Zealand

Re: Changes to search

Post by djnzx48 »

I'm not 100% sure this is correct, but would the following regex work?

^(?:.*[\p{L}\p{N}]){3}.*$

It looks for at least three Unicode letters or numbers in the string, and should work for other character sets as well.
User avatar
PeterJ
Site Admin
Posts: 6873
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: Changes to search

Post by PeterJ »

djnzx48 wrote: Wed Apr 03, 2019 5:17 am I'm not 100% sure this is correct, but would the following regex work?

^(?:.*[\p{L}\p{N}]){3}.*$

It looks for at least three Unicode letters or numbers in the string, and should work for other character sets as well.
Thanks. We had looked at regex, but had gone for the PHP count commands. I will PM you our current PHP function and we can discuss.
User avatar
PeterJ
Site Admin
Posts: 6873
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: Changes to search

Post by PeterJ »

djnzx48 wrote: Tue Apr 02, 2019 11:45 pm Doesn't this prevent non-English language searches from working? For example, try searching for "ńńńńń" and it says you need "at least 3 alphanumeric characters".
Do you happen to know if those characters are
UTF-8?

EDIT:

Is this it?

https://www.fileformat.info/info/unicod ... /index.htm
User avatar
djnzx48
Manic Miner
Posts: 730
Joined: Wed Dec 06, 2017 2:13 am
Location: New Zealand

Re: Changes to search

Post by djnzx48 »

Uh, I think so? I just searched and found it here: https://codepoints.net/U+0144. It was an example that I got from looking in this thread.

I don't actually have any PHP knowledge, but if I can be of any help then I'd be willing to try.
User avatar
PeterJ
Site Admin
Posts: 6873
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: Changes to search

Post by PeterJ »

Thanks for the link.

Things like Extraña do actually work fine due to the work [mention]Einar Saukas[/mention] did.

What titles are you thinking about where the search would be problematic?
User avatar
djnzx48
Manic Miner
Posts: 730
Joined: Wed Dec 06, 2017 2:13 am
Location: New Zealand

Re: Changes to search

Post by djnzx48 »

Well, I haven't found any proper examples yet since the majority of entry titles seem to be converted to the standard Latin character set. But if you just wanted to search for e.g. "aña", then you won't get any results. (And searching for it in the advanced search gives results for "ana" as well.)
User avatar
PeterJ
Site Admin
Posts: 6873
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: Changes to search

Post by PeterJ »

Thanks for the example [mention]djnzx48[/mention].

Let me review, over the next few days. I won't implement on the advanced search until we have a resolution. I appreciate the feedback.

There are hundreds of posts on Stack Exchange about this sort of thing.
User avatar
PeterJ
Site Admin
Posts: 6873
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: Changes to search

Post by PeterJ »

[mention]djnzx48[/mention]

Can you try it now. I have implemented the following:

https://github.com/infralabs/DiacriticsRemovePHP

Peter
User avatar
PeterJ
Site Admin
Posts: 6873
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: Changes to search

Post by PeterJ »

R-Tape wrote: Tue Apr 02, 2019 10:24 pm Ta!

Is there any way that e.g. "3D" could be a viable search?
[mention]R-Tape[/mention]
Can you try it now with '3D ' (That is 3D or 3d followed by one space). Not perfect, but small steps...
User avatar
R-Tape
Site Admin
Posts: 6402
Joined: Thu Nov 09, 2017 11:46 am

Re: Changes to search

Post by R-Tape »

PeterJ wrote: Wed Apr 03, 2019 9:04 am @R-Tape
Can you try it now with '3D ' (That is 3D or 3d followed by one space). Not perfect, but small steps...
Excellent! Thanks.
User avatar
djnzx48
Manic Miner
Posts: 730
Joined: Wed Dec 06, 2017 2:13 am
Location: New Zealand

Re: Changes to search

Post by djnzx48 »

It looks like it's gone back to the old behaviour now... as in input is unfiltered and wildcards can still be searched. That PHP script might work, but I suppose it would mean that non-Latin alphabets (such as Russian) could not be used? Not that there are currently any Russian titles in the database anyway.
User avatar
PeterJ
Site Admin
Posts: 6873
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: Changes to search

Post by PeterJ »

Try again please.
User avatar
PeterJ
Site Admin
Posts: 6873
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: Changes to search

Post by PeterJ »

[mention]djnzx48[/mention]

When you enter in a search now you will see three data fields above the search results:

Entry Text: aña
Processed Text: ana
Character Length: 3

These columns will be removed after the testing phase.

I'm not going to implement non-latin alphabets.
User avatar
djnzx48
Manic Miner
Posts: 730
Joined: Wed Dec 06, 2017 2:13 am
Location: New Zealand

Re: Changes to search

Post by djnzx48 »

OK, yep. The Latin character replacement thing seems to be working. But it's still allowing wildcards for me.
User avatar
PeterJ
Site Admin
Posts: 6873
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: Changes to search

Post by PeterJ »

djnzx48 wrote: Wed Apr 03, 2019 9:54 am OK, yep. The Latin character replacement thing seems to be working. But it's still allowing wildcards for me.
Try one more time for me please!

Entry Text: ***
Processed Text: ***
Character Length: 0

https://www.youtube.com/watch?v=FGBhQbmPwH8

[mention]R-Tape[/mention] & [mention]Joefish[/mention] - '3D' temporarily removed, will be back as soon as I know why it's breaking other things!
hikoki
Manic Miner
Posts: 576
Joined: Thu Nov 16, 2017 10:54 am

Re: Changes to search

Post by hikoki »

Hi Peter. Could you add a Machine filter for All Classic Spectrum models? Thanks for the site.
User avatar
PeterJ
Site Admin
Posts: 6873
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: Changes to search

Post by PeterJ »

hikoki wrote: Wed Apr 03, 2019 11:45 am Hi Peter. Could you add a Machine filter for All Classic Spectrum models? Thanks for the site.
Hi, yes. Good idea. Will add to the list.
User avatar
PeterJ
Site Admin
Posts: 6873
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: Changes to search

Post by PeterJ »

[mention]R-Tape[/mention]

'3D ' now working again. Note - Uppercase D and space at the end. Apologies for the issues.
User avatar
Fahnn
Microbot
Posts: 135
Joined: Sun Jan 27, 2019 7:56 pm
Location: Redcar, UK
Contact:

Re: Changes to search

Post by Fahnn »

This probably isn't anything anything that anyone else wants (and if so, please just ignore me), but is it possible to search for games that have an entry in the "Comments" field? Some of the comments have some great information (e.g. Bandersnatch, Sqij!, etc.) and I'd love to be able to find more of that sort of thing.
User avatar
PeterJ
Site Admin
Posts: 6873
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: Changes to search

Post by PeterJ »

Fahnn wrote: Wed Apr 03, 2019 2:42 pm This probably isn't anything anything that anyone else wants (and if so, please just ignore me), but is it possible to search for games that have an entry in the "Comments" field? Some of the comments have some great information (e.g. Bandersnatch, Sqij!, etc.) and I'd love to be able to find more of that sort of thing.
Thanks for the suggestion. I could do you a CSV or Excel export of all the games with comments, and include the comments. Would that help?
User avatar
hitm4n
Manic Miner
Posts: 620
Joined: Fri Nov 17, 2017 12:56 pm

Re: Changes to search

Post by hitm4n »

This is what we are using, and we are trying to avoid allowing search returning huge numbers of rows
Just throwing this thought in the ring...

If limiting number of results why not allow any old stupid search criteria but then limit what is returned to screen and post a message saying...

"This search generated more than 500 results, please refine your search criteria"

Or whatever number or message you see fit. Then all this work isn't needed?
Just an idea.
I don't have anything cool to put here, so i'll just be off now to see a priest with yeast stuck between his teeth and his friend called Keith who's a hairpiece thief...
Post Reply