Suggestions for Beta Search


chess_rock
Member
Registered: 19.11.11 22:52
Timezone: UTC +0
Posts: 16

Hey there people,

What do you think of creating an advanced search?

Also, I looked for "%00%00" and listed all topics in the search, which made a big list appear in my screen. Maybe it'd be cool if you could add some infinite scroll on the search list if the results count is big. Infinite scroll is not necessary though, separating results in pages is also nice if done with ajax.


ynori7
Administrator
Registered: 24.08.11 12:16
Timezone: UTC +2
Posts: 165

Yeah I also think the search needs some work I didn't spend very much time on that piece. I don't know so much about making an efficient searching algorithm. Any ideas?

As for the infinite scroll idea, I think we can include something like that. I'll put it on the todo list.

i537.photobucket.com/albums/ff338/ynori77/archenemysig1.jpg


chess_rock
Member
Registered: 19.11.11 22:52
Timezone: UTC +0
Posts: 16

ynori7 wrote:
Yeah I also think the search needs some work I didn't spend very much time on that piece. I don't know so much about making an efficient searching algorithm. Any ideas?

If I had to build an algorithm, i'd try to build something like a google like search.

Let's suppose the input: biggest "white elephant" in the world

I'd split the strings inside quotation marks using regex, and afterwards, the strings separated by spaces programatically. I would then add those strings to a list and send them to the query using a LIKE IN clause.

SELECT col FROM tbl WHERE text LIKE IN ( '%biggest%','%white elephant%','%in%', '%the%', '%world%' )

This would be my approach since LIKE is much faster than regex on databases, especially, mysql, my favorite database flavor and since it would have a complexity close to O( N ).

It would also be cool to have the possibility of picking which sections of the website to search for and the date which the information was posted approximately (from-to). This would make searches much easier. I'd use parameterized queries as this would be a hell difficult of a query to build using procedural language or string concat due to security reasons.

You could also build a list of prepositions so that you don't need to look for prepositions on the search like google does. I guess this would make searching way more casual and easy to learn.

Does this sound like what you want, or were you looking for some string matching algorithm like the Rabin–Karp algorithm?


ynori7
Administrator
Registered: 24.08.11 12:16
Timezone: UTC +2
Posts: 165

Seems like a reasonable idea. I'll give it a shot. I don't think I've ever seen the LIKE IN clause before though. Do you know if it's standard in mysql?

i537.photobucket.com/albums/ff338/ynori77/archenemysig1.jpg


ynori7
Administrator
Registered: 24.08.11 12:16
Timezone: UTC +2
Posts: 165

It doesn't look like the LIKE IN clause exists for me, but I just discovered MATCH AGAINST which looks like it was intended for searches. Looks promising and pretty simple to implement.

i537.photobucket.com/albums/ff338/ynori77/archenemysig1.jpg


ynori7
Administrator
Registered: 24.08.11 12:16
Timezone: UTC +2
Posts: 165

Alright, I upgraded the search so that it doesn't only return exact matches like before, and it sorts the results based on relevance and displays that relevance to the user.

i537.photobucket.com/albums/ff338/ynori77/archenemysig1.jpg


chess_rock
Member
Registered: 19.11.11 22:52
Timezone: UTC +0
Posts: 16

Sorry, for the late reply. I have this bad habit of not looking for clauses in mysql. I work with Oracle and that clause is extremely life saving, thought it also existed on other databases.

I really enjoyed the new search, it does not care if i write things out of order, which makes things extremely easy. But if i use big search queries with lots of terms the query becomes a bit heavy. For example, if i try the input:

a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z 

I guess it'd be a good idea if you filtered the amount of terms you can have separated by spaces.

The other thing i had mentioned was the advanced search. Is is possible to choose the section of the site I want to look for? Does the search look for information in the forum threads? How will you fragment information when the search result is too big?

I have to admit the new search is way better than before. Congrats! grin


ynori7
Administrator
Registered: 24.08.11 12:16
Timezone: UTC +2
Posts: 165

chess_rock wrote:
For example, if i try the input...

That input didn't return any results for me, and also didn't take very long, so I don't really understand what you mean there.

At the moment it doesn't search the forum since I haven't integrated forum stuff into the beta section yet, but it will.

For the advanced search, maybe I could add some filters and other options for narrowing the search results.

i537.photobucket.com/albums/ff338/ynori77/archenemysig1.jpg


chess_rock
Member
Registered: 19.11.11 22:52
Timezone: UTC +0
Posts: 16

ynori7 wrote:
That input didn't return any results for me, and also didn't take very long, so I don't really understand what you mean there.

Oh, that was a coincidence then. When i searched for that input and longer ones, I guess the server was slow. Now it's working normally. My mistake.