What do people use Elasticsearch for? - php

I am wondering what peoples use case is for using Elasticsearch. I am started a social networking site that will have places, vets, people, pets, pet shops etc.
Can someone please tell me how Elasticsearch would help me in this type of search, as I need to search all necessary collections and rows.

You may create endless report with the help of logstash, logstash forwarder, and Kibana plugin. For example a heatmap to display geographical location of the user, an historical line chart to display total number of activities of the day, most favourite topic of the day, week, or month, chart to display most active user, topic etc, user's demographic interest etc.

Related

How to implement cross selling on a website?

I have a website which is custom made. I haven't used any carts like Zencart etc. Again it is completely built custom.
I have to implemnt the following on the site.
People who viewed this also viewed
People who bought this also bought:
Popular Today: top 5 products
Recently viewed products by a customer:
Cross selling emails etc.
I have looked into Analytics softwares like Piwik, Google Analytics, clicky.
I know we can store this data as events in Piwik or GA.
The main question is how do I get this data and be able to formulate it and display products according to it on the site?
As for item 2) "People who bought this also bought", Google has released a related product feature that, in theory at least, should it make easy to implement this.
The feature needs to be enabled in the view settings and you need some days of e-commerce data. Then you execute e.g. the example query from the docs:
dimensions=ga:queryProductName,ga:relatedProductName,ga:queryProductId,ga:relatedProductId
metrics=ga:correlationScore,ga:queryProductQuantity,ga:relatedProductQuantity sort=-ga:queryProductQuantity
Presumably a higher correlation score metric indicates which products have a stronger relationship.
The problem I have so far is that this is a blackbox - I do not know how Google computes the correlation score and so far the results look somewhat arbitrary (it might be that my dataset is not yet large enough). You can query the correlation model, but that will return "default" (not really helpful).
However if you are prepared to take a leap of faith and trust Google that this all will make sense then you can use the related product feature to implement cross selling in your website.
Query the data via the API and don't forget to cache the results, else you will eventually exceed your GA quota. After that it's just a matter of matching product ids on your product pages to the related product id with the highest correlation scores in the cached results.

Google analytics service provider leads

currently working with Google analytics to get a list of companies based on GA's Service providers (which after a filter of "default ones" I can determine the leads). Now I would like to be able to get an overview of urls visited per lead. I can't find any way to get those service providers linked to visited urls in the API.
P.S. only interested in results of last 24 hours so I don't need full histories.
I would just request ga:pagePath, ga:networkLocation dimensions ga:pageViews metric then add a filter on with ga:date = today. The filter will ensure that you only get data back for today.
This should give you a list of the Network domans and what pages they viewed today.
There is a problem with this it can take a while for google to process the data i have read any where from 4 - 8 hours. I normaly filter on yesterday that way i'm almost always sure that all the data was processed. You could try with the realTime api but then there isnt much data there and there are a limited number of dimensions and metrics you can select from it. I'm not even sure that what you are looking for is available.

Best method of storing data for android application?

For my final year project, I decided to create an android app but unfortunately I have no experience with android development. Just a quick question which has confused me for the last few weeks, and I was hoping someone here could give me some advice and guidance.
I'm wanting to create a kind of student (university) guide to the UK, allowing the user to browse through bars and clubs suggested by other students.
For the purpose of the project, the data contained on the database will be about bars and clubs in my area which have been chosen by myself. If everything goes well I hope to publish the app to the android market, I would then produce a website where students could contribute their suggests and rate existing.
I'm slightly unsure of the best way to store the data. Whether using internal storage (SQLite) or server based using MySQL and PHP. As I'm currently still at the design stage of the process, I have no idea of the size of the data or database.
The database will store a variety of information
Venue details (general info,contact details,website, Facebook page)
Google maps (gps location data on venues - longitude and latitude i think)
Drink prices (price of cheapest lager and cider for every venue, eg strongbow £2.60)
Student offers (drink or ticket offers such as double vodka £2 or £3 entry with NUS card)
Student nights (info on the event such as name,theme,entry,entry time, music and possibly a small description at the bottom of around 500/600 characters)
The drink offers will be linked to the student nights rather than been a separate element, whilst on the night profile by clicking a tab or sliding the screen to the left will show you the drink offer relevant to that night
Example of a possible description on student night page
Faces is the new Monday night the town has been talking about. Launched in November Faces offers a different clubbing experience to most other club nights out there. With resident djs from Koosday Newcastle and a hand picked selection of male and female hosts, Faces is really a cut above. Each Monday we operate 4 rooms with music spanning across all genre's complete with a brand new VIP room. Drinks from 99p and a new cocktail menu to get your mouth watering. Full club decor has been installed along with a re jig in each room to make Faces the ultimate club night.
Any information or advice would be much appreciated
Thanks
I would actually go for something along the lines of MySQL and PHP. An sqlite database would be difficult to manage with user contributions.
Set up an php based api and have your applications talk to it using json encoded requests. That way all users have access to the same database. It would require internet access, but would help avoid synchronization problems when a user contributes data.
Since you anticipate users populating the data overtime via a web interface, you'll need to store the data in the network using your favorite database and web application framework. MySQL and PHP should work fine.
You may still want to use the SqlLite database on the device for caching purposes.

Email notifications for when events align with location. How?

I am looking at building a webapp in php/mysql that people can log into, and sign up to receive email notifications when a certain event is at their chosen location, e.g a jack johnson concert in new zealand, receivng a notification when he comes to that location to perform. I am guessing that there is some online concert database that apps like shazam use that i could intergrate with.
Any help on building this sort of app would be appreciated, most importantly the notification system and how that integrates with another concert database and the users details .
I have a basic knowledge of php/mysql, I'm guessing I should use a framewok for this, if anyone knows one useful for this task that would be appreciated too.
Thankyou!
Always check ProgrammableWeb when looking fr APIs. I found the Gruvr API:
Gruvr offers tons of geocoded concert data, with about 170K upcoming
shows for 45K bands currently listed. You can ask for upcoming
concerts by location or by band. The results can be returned as
geoRSS, KML, or dynamic map links.
For triggering events, checkout momentapp, which lets you schedule delayed HTTP requests.
Maybe you could start from there. What you could do is when somebody signs up with their location, check Gruvr if there are any upcoming concerts in their area, then schedule a request with momentapp which will trigger your email notification script at a specified time before the event to alert the user.
You can also use CRON as an alternative to using a 3rd-party service like momentapp.
I think your question can be broken down into more questions.

Best way to implement a Calendar interface using Google Cal feeds for events?

I'm building a site for my school as a pet project, which would include accounts for all students. I want to display a calendar for each student that should have the following features:
It should be able to import events from multiple Google Calendar feeds. Compatibility with either the XML, ICAL or HTML feed will do.
It should be able to give different colors to different events based on the feeds which they originated from.
It would be nice if the calendar could also give different colors based on certains tags in the event titles, like all events starting with "Test: " will be red, and all events starting with "Deadline: " can be blue.
The interface should be nice, but simple. It should be easy to implement, and no dependency on Javascript would be good. Preferably, it will work simply on PHP.
It must provide 3 views of the calendar: Month, Week & Agenda
Features I don't require are:
Write ability (the calendars can/should be read-only)
Multiple-day events or recurring events
Links or html content inside events
What would be the simplest pre-made solution to implementing this? Currently, I am trying out various solutions like FullCalendar, and the various solutions listed at the Plans Website. However, none of them are perfect, because either they are not supported any more, or require javascript, or don't have all the features I need. I'm also gonna check out the GWT-cal plugin, and the Zend Calendar GData framework, but any feedback on your experiences with any of these would be good.
Can someone suggest the easiest way of getting this working?
Ok the word limit on comments is ridiculously low and irritating, so after having posted two comments and still having more to say, I decided to just post an answer. Sorry...
Yes, GCal is perfect, but I can't trust the technologically challenged students of my school to manually subscribe to ical feeds. So i wanna provide a site where people can select from a list of courses, and automatically get a customized event feed.
Right now, I have a rough implementation going by making a common Google Account that has separate calendars for each course. Then with some url trickery, I embed a custom iframe that gives a special read-only version of the calendar with only the calendars applicable to that specific user. This will probably raise problems when I want email notifications of events and stuff, and might force me to go into the Google Calendar API in detail. :(
Can you check out my other question at Is there anything wrong with the way I'm implementing a Calendar on my site? and give some feedback?
you should check out gwt-cal. versin 0.8.x only provides day/week view but the 0.9.0 branch implements an Agenda view with a Month view in progress.
First of all, GWT-cal is not PHP, it is Java. Secondly, why do you not want to work with JavaScript? Finally, if you are importing it all from Google Calendar, why not use Google Calendar as it has almost all you are requesting and can handle all of the user accounts and such?
The way I understand the project is you are attempting to either make one page that displays many different calendars from all the students or have each student sign in and view their calendar. Is that correct?
I would build (or find) an app that mixes the selected iCal feeds together to create a new feed, so that it can be subscribed to in GCal/iCal/Outloook/30boxes/...
If you still want a display you might try WebCalendar.
IIRC there are also some Drupal modules for this kind of thing.

Categories