PDA

View Full Version : Search results sorting



Flying Mullet
07-05-2005, 04:28 PM
Would it be difficult to make search results sortable? i.e. you can click on the "Thread", "Thread Starter", "Forum", etc... header to sort your results by that column to make searching a little bit easier?

Agent Proto
07-05-2005, 04:32 PM
I don't think it can work that way. Besides, the current search system works just fine! Why make it even more complex than it is already?

edczxcvbnm
07-05-2005, 05:18 PM
I just want to see restrictions removed on what you search for having to be longer than 3 letters. Sometimes the word or thing is just that short damn it.

Flying Mullet
07-05-2005, 05:34 PM
It shouldn't be too hard. You just have to add an "Order By" clause to the end of the sql string and then search again.

Yamaneko
07-05-2005, 06:44 PM
It wouldn't be too hard to do that, no.

ed: reducing the size of searchable words increases the size of the search index.

edczxcvbnm
07-05-2005, 08:24 PM
Search index? I don't quite understand. Isn't every post put into the database and when I search it goes through those posts in the database? I don't understand searching quite that well but that is how I have always done it. I may get more results but if it helps me to find what I want then awesome.

crono_logical
07-05-2005, 08:56 PM
If I rebuild the search index, expect 6+ hours of forum downtime :p What words are that short that you're searching for? I could add it to the length exception list if it's not something silly like "the" :p

And looking how searches are stored in the database, it might need a hack to do that sorting thing, despite being relatively simple, so not doing that :p

Yamaneko
07-05-2005, 08:58 PM
Normally, every word of four or more characters automatically gets built into the search index after every post, unless an admin has disabled that function. After a major upgrade, though, like when we upgrade to vB 3.5.0, the search index has to be completely rebuilt. If we allow words smaller than four characters to be indexed, the search index becomes bloated. The entire point of a search index is so that searches can be performed quickly and with minimal stress on the database.

crono_logical
07-05-2005, 09:07 PM
It's already bloated, 8.1m entries in it :p

Yamaneko
07-05-2005, 09:12 PM
Delete the index and start off with later post IDs. No one wants to search for Oldbie so-and-so's posts. :p

edczxcvbnm
07-05-2005, 09:16 PM
I obviously have no clue how the searching really works on Vbullitin. I can't remember the words that I search for every now and then that are shorter than 4 words. Most of them are probably acryonims. I admit I don't use the search feature very much but when I do it seems to be a problem.

crono_logical
07-05-2005, 09:18 PM
Delete the index and start off with later post IDs. No one wants to search for Oldbie so-and-so's posts. :pStill need a huge downtime, considering the skew of the distribution of posts over time towards more recently as the forum size grew rapidly :p

Samuraid
07-05-2005, 09:29 PM
Sorting the search results probably wouldn't be too bad on the database, but it would likely require us to modify the vBulletin source code a bit which we are trying to stay away from doing.

As for setting the 3 character search limit... Yams is right, although vB's current method of using an external search table is old. Mysql has a built-in fulltext index that we should be using instead (unfortunately, vBulletin 3.5 needs to come out first) but even that limits words to 4 charaters or more.

crono_logical
07-06-2005, 08:26 AM
Does mysql's built-in index allow you to do partial-match searches easily?

Samuraid
07-07-2005, 12:40 AM
Like phoenetic matches?

I'm not perfectly sure, but I don't think so. You would probably need to create a metaphone/soundex index table for that.

crono_logical
07-07-2005, 07:00 AM
Not phonetic, but I meant like cat*, basically wildcard matches :p

-N-
07-07-2005, 07:22 AM
I thought it does that without you having to type the asterisk...

Endless
07-07-2005, 07:50 AM
Not phonetic, but I meant like cat*, basically wildcard matches :p

% is the wildcard.

Samuraid
07-07-2005, 05:19 PM
Not phonetic, but I meant like cat*, basically wildcard matches :p

% is the wildcard.

If you are talking about the actual SQL query, that is correct.

crono_logical
07-07-2005, 07:30 PM
I'm talking about mysql's built-in fulltext index :p

Yamaneko
07-07-2005, 08:37 PM
You'd need to use LIKE and RLIKE, no?

Endless
07-07-2005, 09:26 PM
Yeah, I'm pretty sure % doesn't work with binary operators.

Edit: Since clout is a lazy bum :p:
http://dev.mysql.com/doc/mysql/en/fulltext-search.html

edczxcvbnm
07-07-2005, 09:43 PM
My GOD! What have I done? I just wanted to be able to search every inch of every post like I would using normal SQL with out a retarded search index ;_;

Loony BoB
07-07-2005, 11:00 PM
clout is right, the rest of you suck. When using vBulletin, you can search using * as a wildcard. In other words, if you search for bullet, you'll get all occurances of the exact word of bullet. If you search for *bullet*, you can end up with posts including such words as vBulletin. So yeah, when searching in the forums using the forums, use * as a wildcard.

ed, if you ever have a word you want to add to the three-letter-limit-thingy, just come and post in this thread and an admin can probably add it in.

EDIT: You can also use AND or OR when searching for multiple words.

Endless
07-08-2005, 08:58 AM
BoB..


I'm talking about mysql's built-in fulltext index :p

Loony BoB
07-08-2005, 12:23 PM
You still all suck and so does clout in that case. Since this discussion has been based on searches on posttext, you don't need to do partial searches in the database itself if you can do them right here in the forums.

Endless
07-08-2005, 01:54 PM
The idea behing the built-in text index is that it allows natural search, i.e., if I searched for "caike", it would also return posts containing "cake". Besides, I wouldn't be surprised if the built-in full index took less space than vB's search index.

Loony BoB
07-08-2005, 03:20 PM
A spellchecking search? o_o

Flying Mullet
07-08-2005, 03:21 PM
Hey, quit molesting my thread and get back on topic! This thread is about sorting, not search indexes. :p

Loony BoB
07-08-2005, 04:15 PM
Wait until vB3.5.0 and then we'll talk about any changes to code. It should be within the next six months. But for now, the answer to the original question is 'no'.

Samuraid
07-08-2005, 07:45 PM
The idea behing the built-in text index is that it allows natural search, i.e., if I searched for "caike", it would also return posts containing "cake". Besides, I wouldn't be surprised if the built-in full index took less space than vB's search index.
Ah, so fulltext does use relevancy matching...that almost negates the need for metaphone keys. Very cool, thanks for checking that out Endless. :D