留言板

Location based web content

purple stickmen,修改在11 年前。

Location based web content

New Member 帖子: 2 加入日期: 11-8-26 最近的帖子
What is the best way to achieve location based content?

I would like to display content that is relevant to my users location - i.e. geographic region. If a user views the site from the US, I would like them to see US related content, whereas if they view the page from UK, for them to see UK relevant content. I don't want to use locales to control this, as within the US site I may still want a user to view the US page in chinese for example.

I thought I had seen a liferay demo before where this was done, and had made the assumption it was an existing portlet - but it doesn't seem to be.

Any ideas how this could be accomplished?
thumbnail
Praveen Singh Bais,修改在10 年前。

RE: Location based web content

Junior Member 帖子: 29 加入日期: 14-1-28 最近的帖子
Hi Neil
We have a similar requirement for one of our projects do you have some idea how this can be done??
thumbnail
Ravi Kumar Gupta,修改在10 年前。

RE: Location based web content

Liferay Legend 帖子: 1302 加入日期: 09-6-24 最近的帖子
Use tags to categorize your content. Get user location when user logs in. Create a custom portlet to show content. Filter contents based on tags matching location of user.. a simple approach. Not sure if liferay offers something else.. But this approach should work on all liferay versions.

-Ravi
thumbnail
Praveen Singh Bais,修改在10 年前。

RE: Location based web content

Junior Member 帖子: 29 加入日期: 14-1-28 最近的帖子
Thanks Ravi,

What we are actually looking for is an "around me" kind of search where the user provides the distance within which he wants to perform the search on the contents in the website.

Also it would be better if the operation to choose the radius can be done on a map?

Regards,
Praveen
thumbnail
Ravi Kumar Gupta,修改在10 年前。

RE: Location based web content

Liferay Legend 帖子: 1302 加入日期: 09-6-24 最近的帖子
Then second option..

If you need to get content within defined radius, you need to get that with latitude and longitude. Get Google Maps. Get bounds of the map within defined radius. Get Latitude Longitude.

Every content has to be somehow categorized based on coordinates if you are looking for this kind of search. So location/lat-lang would be a part of content somehow. Write logic for the same. You can use custom attributes of type double to store lat-long. When you are searching something, you get the latitude start and latitude end similarly for longitude. Run the query and get all contents within the area desired..

How's that?
thumbnail
Praveen Singh Bais,修改在10 年前。

RE: Location based web content

Junior Member 帖子: 29 加入日期: 14-1-28 最近的帖子
Hi Ravi,

We are thinking of using spatial search provided by solr for this. So our high level approach is, whenever a new user, content etc. is created in the system. We will associate a latitude, longitude against it using the user's address . The latitude longitude will be indexed in the solr search engine.
Solr has capability to search based on location. so for display purpose in liferay, we will fire a search query with the current location and radius, and use the search result to display the content in the portlet.

We are new to liferay and need opinions of experts to know whether we are going in the right direction.

Thoughts ??
Gaurav Jain,修改在8 年前。

RE: Location based web content

New Member 发布: 1 加入日期: 15-9-16 最近的帖子
Hi Praveen,

I am wishing to do the same thing, you talked about.
How you did that?
without firing any query for Solr ie I m trying to perform spatial search in liferay, without making any connection to stand alone Solr.
How can this be done?