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.


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: 144

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


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

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?


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: 144

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: 144

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: 144

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: 144

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