News:

Wondering if this will always be free?  See why free is better.

Main Menu

Search string inside the url

Started by str4hler, August 25, 2016, 05:04:54 AM

Previous topic - Next topic

str4hler


Dear all,


I would like to see the search string inside the url.


Ergo, I search for "test" via http://www.simplemachines.org/community/index.php?action=search
The search results will show on http://www.simplemachines.org/community/index.php?action=search2
But the url should then show something like (not working) "index.php?action=search2&q=test"


Is this an option within SMF? Or is there a mod/code change for this?


Thanks for your assistance!
[size=78%](I searched the manual and forum for an answer, but did not find one. Sorry in advance if I missed something...)[/size]

Illori

SMF really does not support adding the search terms to the URL. i dont believe any mod exists to add this feature.

str4hler

That's a pity...
Thanks for your fast answer!

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

str4hler


Good question. Thanks for asking.


I use SMF for two things:
1. Discussions (about geological topics), and
2. as a database to store information. Each topic is a Table of Content of a magazine or book.
   A Table of Content can contain an article about, let's say, "diamond".
   I want to point people with one url, to all books and articles about "diamond" in the forum.


Just like http://forum.amiminerals.it/search.php?keywords=diamond [nofollow]


Kindred

hmm.....   interesting.


oddly enough, you can actually pre-fill the advanced search form from the URL

index.php?action=search;advanced;search=diamond

that does not TRIGGER the search though.

So, I'd suggest posting in mod-requests....  because it probably would not be too hard to take the advanced search URL and trigger the actual search.

actually... never mind. just noted. it works on search2 as well

http://www.simplemachines.org/community/index.php?action=search2&search=diamond

not sure how the results are sorted though
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

equinoxmatt

Hi,

It looks like the search is done as a post request.  It also looks like the code look for a GET Request to.  This works:

http://www.simplemachines.org/community/index.php?action=search2&search=diamond&sort=relevance|desc

If you change sort to relevance|asc it changes the sort order. The default params when doing it via the search box seem to be:

advanced = "1"
searchtype = "1"
userspec: "*"
sort: "relavance|desc"
minage: "0"
maxage: "9999"

I *think* you can put these all in the URL to customize your search results.

I hope this helps!  ;)

Illori

Quote from: Kindred on August 25, 2016, 08:12:40 AM
actually... never mind. just noted. it works on search2 as well

http://www.simplemachines.org/community/index.php?action=search2&search=diamond

not sure how the results are sorted though

i am not sure it will work on all installs, this forum it works because that is how the quick search mod we have puts the search into the search page.

Kindred

nope, Illori...   I tried it on three of my own forums and it seems to work
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

str4hler

It seems to work well on my SMF installation too (2.0.11 ),
so... this is a perfect solution/workaround.


Thanks very much for your fast, good and nice help !


Advertisement: