d2jsp
Log InRegister
d2jsp Forums > d2jsp > General Help > Site Suggestions >
Poll > Introduce Search Filter In Trade Forums
Closed New Topic New Poll
  Guests cannot view or vote in polls. Please register or login.
Member
Posts: 3,033
Joined: Nov 28 2006
Gold: 4,608.99
Dec 22 2021 09:18pm
Hi,

close/delete this topic please.... i made a huge mistake ;]

tl:dr
user input search string eni enigma
current solution:
returns only posts including BOTH words: eni AND enigma

my proposal:
keep current search as it is right now but also
allow ( ) operator to make search string like: (eni enigma)
would return all posts including ANY word: eni OR enigma


I will write it as short as i can :)

search is seeking for specific strings through post title and content

You can:
1. Search through specific words/strings, like eni, enigma or base, etc..
2. As far as i know you can search through strings like "eni mp" - this will consider ONLY entire string in provided order
3. If you specify many words in one search queue, for example: enigma dusk 15ed your search results gonna have all of the words but not 100% quite what you asked for ;)
For example you can get result (that is just ONE post) as follows:
Quote
topic: My offer list
Content:
-mp enigma base 3os
-dusk coh 12%
-eth kraken shell 4os 15ed


Quote
tech jibba jabba for devs only:
So...
Specyfying more than one word in search phrase makes (i simplify it to 'post_content' column only) queues +/- like this:
Code
SELECT * FROM posts WHERE contents LIKE "%enigma%" [B]AND [/B]contents LIKE "%dusk%" [B]AND [/B]contents LIKE "%15ed%"

This returns every post containing those three words, but it does not really give user right he/she expected :)


Obviously as i said you could put your search string in " ", making it: "enigma dusk 15ed" but that is not going to work just as well...
What if some user uses eni not enigma word in his/hers post?

So the way it works now if you want to search for exact perfect result of enigma dusk 15ed you have to do multiple searches:
1) "enigma dusk 15ed"
2) "eni dusk 15ed"
3) "eni ds 15% ed"
4) "enigma ds 15ed"
... and we could probably find 20-30 more variations and combinations ;)
This is a huge problem.

many people add tags to their posts to get around this problem and make their posts more visible to higher population :)


You can NOT:

1. That is the idea here - search for many alternative words in just one search query - to introduce such mechanism

So let's make a simplification of previous example, and assume that someone wants to search trade forum just for a random 3 socket AP/MP/DS enigma base.
Now search strings that user input would looks like this:
Quote
1a) "3os archon plate"
1b) "3os ap"
1c) "3os archon plate"
1d) "3 soc archon plate"
1e) ...
1f) ...
1g) "3soc archon plate"
....
1x) "archon plate 3sox"
1y) "archon plate 3os"
1z) "archon plate 3 os"
well, let's say the list of variations is HUGE.... and that's just for archon plate :banana:
let's continue... shall wel?
2a) "3os mage plate"
2b) "3os mp"
...
2z) "mage plate 3 os"

3a) "3os dusk"
3b) "3os ds"
.... etc....
3z) "dusk shroud 3 os"


that is a quite huge list of search attempts one have to do to seek through all variations and possibilities....
I think current solution is far from perfect, and it can be adjusted VERY quickly.

So my idea is to introduce simple mechanism, that will allow that in just one simple search.
Simply add/allow brackets in search string ( ) that user inputs, then parse it on server accordingly.
Every word in brackets (eni enigma) shall be searched with SQL OR operator.

For example search string (from point can not 1. above) to search trade forum for random 3 socket AP/MP/DS enigma base
instead of that huge long list of many search strings, you could just use one that would look lke this:
(dusk ds ap mp "archon plate" "mage plate") (3sox 3os 3sox 3soc "3 sox" "3 os" "3 sox" "3 soc")
Well, it requires some more typing from users, but overall it will benefit everyone :) users getting results in just one search, and server performing just one query instead of 1000 ;]

Quote
tech jibba jabba again for devs only:
( ) in user input would make equivalent of OR in server SQL query, so query would look +/- like this now:
Code
SELECT * FROM posts WHERE
(contents LIKE "%dusk%" OR contents LIKE "%ds%" OR contents LIKE "%ap%" OR contents LIKE "%archon plate%" OR contents LIKE "%mp%" OR contents LIKE "%mage plate%")
AND
contents IN ("3sox", "3os", "3sox", "3soc", "3 sox", "3 os", "3 sox", "3 soc")

hope i did not make any typo ;]




Tell me what you think :)

ps. similar solution works well on at least one of auction sites i know

This post was edited by Arassuil on Dec 22 2021 10:06pm
Member
Posts: 15,801
Joined: Jul 9 2021
Gold: 291.00
Dec 22 2021 09:49pm
Can you try
Code
eni | enigma


Since the operator OR is supported. Does that work for you?

This post was edited by ChocolateCoveredGummyBears on Dec 22 2021 09:50pm
Member
Posts: 3,033
Joined: Nov 28 2006
Gold: 4,608.99
Dec 22 2021 09:56pm
Quote (ChocolateCoveredGummyBears @ 23 Dec 2021 04:49)
Can you try
Code
eni | enigma

Since the operator OR is supported. Does that work for you?


:|

I don't know how to respond to that...

i mean...
it seems it works as i proposed except you have to use "|" instead of " " (space)
i tried:
(dusk | ds | ap | mp | "archon plate" | "mage plate") (3sox | 3os | 3sox | 3soc | "3 sox" | "3 os" | "3 sox" | "3 soc")

How the hell did i missed that for all this years?!
:wallbash: :wallbash: :wallbash: :wallbash: :wallbash: :wallbash: :wallbash: :wallbash: :wallbash: :wallbash:

have to figure out some more complicated string to test...

This post was edited by Arassuil on Dec 22 2021 09:57pm
Member
Posts: 15,801
Joined: Jul 9 2021
Gold: 291.00
Dec 22 2021 10:01pm
Quote (Arassuil @ Dec 22 2021 07:56pm)
:|

I don't know how to respond to that...

i mean...
it seems it works as i proposed except you have to use "|" instead of " " (space)
i tried:
(dusk | ds | ap | mp | "archon plate" | "mage plate") (3sox | 3os | 3sox | 3soc | "3 sox" | "3 os" | "3 sox" | "3 soc")

How the hell did i missed that for all this years?!
:wallbash: :wallbash: :wallbash: :wallbash: :wallbash: :wallbash: :wallbash: :wallbash: :wallbash: :wallbash:

have to figure out some more complicated string to test...


Yeah, the space basically acts as an "AND" operator :P

There's more examples here: https://forums.d2jsp.org/info.php?p=31 (you probably already know this, just posting in case)

This post was edited by ChocolateCoveredGummyBears on Dec 22 2021 10:02pm
Member
Posts: 3,033
Joined: Nov 28 2006
Gold: 4,608.99
Dec 22 2021 10:03pm
Quote (ChocolateCoveredGummyBears @ 23 Dec 2021 05:01)
Yeah, the space basically acts as an "AND" operator :P

There's more examples here: https://forums.d2jsp.org/info.php?p=31 (you already know the link, just posting it just in case)


no, i did not know that to be honest...

you just made my life SO MUCH EASIER.........
this should be pinned somewhere :D

topic can be closed btw...
Member
Posts: 15,801
Joined: Jul 9 2021
Gold: 291.00
Dec 22 2021 10:06pm
Quote (Arassuil @ Dec 22 2021 08:03pm)
no, i did not know that to be honest...

you just made my life SO MUCH EASIER.........
this should be pinned somewhere :D

topic can be closed btw...


Hehe, I see. Glad I helped a bit, have a good night!
Member
Posts: 10,072
Joined: Aug 4 2007
Gold: 1,555.00
Dec 23 2021 09:38am
Quote (Arassuil @ 23 Dec 2021 05:03)
no, i did not know that to be honest...

you just made my life SO MUCH EASIER.........
this should be pinned somewhere :D

topic can be closed btw...


That wasted effort though. Hahaha rip
Member
Posts: 3,033
Joined: Nov 28 2006
Gold: 4,608.99
Dec 23 2021 09:38am
Quote (Druidika @ 23 Dec 2021 16:38)
That wasted effort though. Hahaha rip


yeah i kinda spent ~1 hour writing that post :D

well, but i think my time was not wasted at all - i learned new feature, also edited my sig :)

This post was edited by Arassuil on Dec 23 2021 09:39am
Go Back To Site Suggestions Topic List
Closed New Topic New Poll