1

I work with a site that employs a site search feature for its users. Before working on this site, I'd come to expect GET-style results with a parameter like "/search?q=entrepreneur" or POST-style results without a parameter like "/careersection/10000/jobsearch.ftl"

This site works a third way that I don't understand, yet. Its SERP page paths look like "/ListJobs/ByKeyword/robotic-dog-farmer/"

The term isn't obscured like it would be after a POST search. Neither is it represented in a parameter as it would be after a GET search. So, what's going on? There seems to be a directory structure that is created on the fly based on the user's input.

  • 4
    I'm not sure what kind of answer you're looking for. You've found a system that is different from other systems you know so far. What is your question? – MetaFight Jul 11 '16 at 14:50
  • Thanks so much for responding, MetaFight. I'll provide some more specific questions: 1) Is this search engine actually using a method that is distinct from GET or POST, or is it some kind of unique implementation of one of them? 2) Is the search application actually creating new nodes in the site directory structure every time a search is performed? 3) If GET is far and away the obvious standard for search engines that don't require POST-style security, why would a site search application function in this directory-structure way? Provides the vendor some benefit, maybe? – Ryan Keeler Jul 12 '16 at 15:09
  • The usual reason I've seen this done is for SEO purposes - each search page looks like a real page to google/bing/etc. It doesn't always work as well as one might like though.... – Jamie Aug 20 '18 at 3:10
1

It can be one of the following:

  • Storing to the database, and mapping URL paths to database queries
  • Storing to a file, and mapping URL paths to file names
  • Storing to memory, and mapping URL paths to data structures

In terms of the URL design, it is stateless:

Imagine a shop where rather than being self-service, there is a shopkeeper who upon being asked, goes and fetches the items you want and rings them up on the till. Now if we were to model that as our online shop we'd see that the client no longer has a basket as part of their state, the basket is part of the shop.

So how would this work? Looking at the interactions between the client and the server, it might look something like this:

Client

Show me your products.

Server

Here's a list of all the products you can buy at this shop.

Client

Good, okay, I'd like to buy 1 of http://example.org/shop/product/X, please place it in my basket, my username is "JohnDoe" and my password is "secretPassword".

Server

Okay, I've added 1 of http://example.org/shop/product/X into your basket, you can review your basket at http://example.org/shop/users/johndoe/basket

Client

I'd like to buy 1 of http://example.org/shop/product/Y as well, please place one in my basket, my username is "JohnDoe" and my password is "secretPassword".

Server

Okay, I've added 1 of http://example.org/shop/product/Y into your basket as well, you can still review your basket at http://example.org/shop/users/johndoe/basket

Client

Actually I don't want http://example.org/shop/product/X after all, please remove it from my cart, my username is "JohnDoe" and my password is "secretPassword".

Server

Okay, I've removed http://example.org/shop/product/X from your basket, you can review your updated basket at http://example.org/shop/users/johndoe/basket

Client

Okay I'm done, ring 'em up, my username is "JohnDoe" and my password is "secretPassword".

Server

Should I charge that to your expense account?

The thing to notice about this conversation is that it is stateless, every action from the client is independent of any other. This means that at any time, the user can run off and do something else, come back a few days later and carry on. It also means they could get some other service to add things to their shopping basket easily.

References

Living without Sessions

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.