How to autocomplete only city(city-town-village) - here-api

Request 'https://places.cit.api.here.com/places/v1/autosuggest?app_code=[app_code]&app_id=[app_id]&at=0,0&q=budapesht' return the list of different places, but I need only places with category city-town-village. How to filter only cities?

If you use this query
https://places.cit.api.here.com/places/v1/autosuggest?at=47.4799441%2C18.9826451&q=town&result_types=category&app_id=[app_id]&app_code=[app_code]
you will only get back results of type "category" that start with "town". That's not what is being asked for.
You can set "result_types=address" so that you don't get back chain, category, or place results, but currently there's no way of filtering such that you only get city-town-village. You will also get administrative areas, streets, etc.

Please try use parameter result_types=category and q="townhalls" or "government-community-facility" in autocomplete suggestions API.
And the category "city-town-village" seems no longer valid.
https://places.cit.api.here.com/places/v1/autosuggest?at=47.4799441%2C18.9826451&q=town&result_types=category&app_id=[app_id]&app_code=[app_code]

Related

eventAction and pageView filters in one request

I'm trying to filter website conversions from Google Analytics for a dashboard. However since it is a mixture of third party leads, events, and page path that contribute to the leads, I have to combine different types of filters. However combining folling metrics, the https://ga-dev-tools.appspot.com/query-explorer/ shows me the value 0 even if that's not correct.
Metrics: ga:totalEvents
Dimension:ga:date
ga:pagePath=#DialogNavigatorVertical,ga:eventAction==Texting form submit
I have tried multiple solutions, but can't figure out how to get the correct data. Can I not combine pagePath and evenAction?
Thank you so much for all your kind help,
Anna
Events by definition are not page views. This means that an Event dimension (category, action, label) can't have page view metrics such as page views or average time on the page because that information does not relate to the specific event.
But you can definitely combine pagePath and evenAction. You are getting wrong results because of one of the following reasons
In your filter, ga:pagePath=#DialogNavigatorVertical is wrong, it must be either == or !=. it cant be an assignment operator
IF you wish to combine two filter conditions using AND that means both must be true, use ;. Semicolon is used for AND operator in filters
IF you wish to combine two filter conditions using OR that means both must be true, use ,. Comma is used for OR operator in filters
In case you are using core reporting api from a backend script, please URL encode the call before hitting. like == must be %3D%3D, space must be %20 and so on.
Please have a look into settings here : https://developers.google.com/analytics/devguides/reporting/core/v3/reference#filters

What is a valid format for params in news bing url?

I'm trying to add some filters to request for news in bing api but currently I don't get any effects of doing this ( for example filter for news from current month).
I'm trying to this with : https://api.cognitive.microsoft.com/bing/v5.0/news/search?freshness=month&?category=business , and replacing some filters here but I always getting the same result.
Currently i want to add three filters : freshness, category and language for news from current day and month.
So it is bug or I'm doing something wrong with filters ?
One problem is that you have an extra "?" in your query. You only need the first one, and then you can use "&" to delimit individual parameters:
https://api.cognitive.microsoft.com/bing/v5.0/news/search?freshness=month&category=business
You might also try adding a market to the query string, like so:
https://api.cognitive.microsoft.com/bing/v5.0/news/search?freshness=month&category=business&mkt=en-us
I'm using 7.0 and don't know what headers you're passing, so I can't test this directly, but it's possible a default market isn't being set. Since categories are market specific, then depending on how Bing handles this, it could plausibly prevent your category from being used.

How to use cursors for navigating to previous pages using GQL and the new gcloud-java API?

I'm using the new gcloud-java API (https://github.com/GoogleCloudPlatform/gcloud-java/tree/master/gcloud-java-datastore/src/main/java/com/google/cloud/datastore) for working with the Cloud Datastore. My specific question is on using GQL for pagination with cursors. I was able to page through the results one page at a time in the forward direction using cursors, but not having any luck with paging backwards.
Example Scenario:
Let's say I've 20 entities in a Kind with IDs 1 through 20. I have a page size of 5. Once I'm on the 3rd page (IDs 11 through 15), if I need to go one page back; i.e. retrieve IDs 6 through 10, what would be the correct GQL/sample code? Again, I prefer not to use offset with a number, but would like to use Cursors.
From what I can tell (actually tested), it looks like one needs to keep track of Start/End cursors for each page as they navigate in the forward direction, then use the saved cursors when there is a need to go back. I just want to make sure if this is the correct/only way or there is a simpler way to accomplish this.
Thanks in advance for your help.
If you add to your original query a sort by key (appended to the end of your "order by" clause), you should be able to reverse each property's sort order and use the latest cursor from your original query to get results in reverse.
Suppose you've iterated through some of the values from your forward query's QueryResults. You can call QueryResults's cursorAfter() method, which will return a cursor pointing right after the last result you saw from your original query. Now you can issue a new query (with the opposite sort order on each property, including the key property) using that cursor as the start cursor. You'll probably want to skip the first result, since it will be the last result you saw from the original query.

Using filters to track hits for multiple URLs

We have a large website that is split up into groups of organisations with a number of micro-sites. We would like to provide one organisation within a group with their own set of data and I am having troubling getting the filtering working.
I think my main problem is I have 2 include filters. According to the documentation:
"If you apply multiple Include Filters, the hit must match every applied Include Filter in order to save the hit."
Our website urls would go something like this: https://[host]/[group]/[site]/[params]. I would like to track the following, given that this client (id 9) is in group "foo":
https://mysite.com/foo/live/default.aspx?id=9
https://mysite.com/foo/live/?id=9
https://mysite.com/foo/reporting/9/*
so that any hits on those urls would be captured for this particular client.
Our 2 current filters (type="Include") are as follows:
/foo/Reporting/9/
/foo/[^\?]*\?id=9
but these do not seem to track everything we think they should. Any help would be much appreciated.
By the time the first filter is done there is nothing left for the second filter to match - the first filter throws everything away that does not match (that's what Google means by "the hit must match every applied Include Filter").
I would suggest you first use an advanced filter to transform your urls so they follow all the same pattern (i.e. grab the value from the query parameter and append it to the url path) and then apply the include filter. I'm pretty certain that would be easier than trying to include different url structures (if you need help with the filters holler away in the comments, but the example given in the advanced filters interface should give you a clue how this works).

Update WordPress Posts Inside Loop

I have some processing inside my WordPress loop, and I want to "cache" the results so that the next time the post is displayed I can use the pre-processed info. The obvious place to store the results is as post metadata.
I have therefore incorporated a number of Update_post_meta calls into my code, along the following lines:
update_post_meta($imagePostID, "imageMeta", $imageMeta);
In this the value of $imagePostID is just the numeric Post ID, which I have already used to retrieve other metadata, so that's OK. I have also confirmed that the code is getting called at the right point.
However, the values are not getting saved, and it looks like for some reason the updates are just being ignored.
Does anyone understand why this is, and if there's any way to get the behaviour I want?
Thanks,
Andrew

Resources