I am seeing some weird behaviors when I use the search API from FourSquare. The site I am building lists all the nightclub spots (www.nationalvip.com)
When I search using 5 categories:
// 4bf58dd8d48988d121941735 - lounge
// 4bf58dd8d48988d11f941735 - nightclub
// 4bf58dd8d48988d1e7931735 - jazz club
// 4bf58dd8d48988d1e9931735 - rock club
// 4bf58dd8d48988d1d8941735 - gay clubs
Some of the nightclubs that are in category: 4bf58dd8d48988d1d8941735 do no show up.
So query like this:
/v2/venues/search?categoryId=4bf58dd8d48988d121941735,4bf58dd8d48988d11f941735,4bf58dd8d48988d1d8941735,4bf58dd8d48988d1e9931735,4bf58dd8d48988d1e7931735&ll=47.6097,-122.3331&radius=10000&intent=browse&v=20120801
Omits this venue:
https://foursquare.com/v/last-supper-club/40b13b00f964a520a7f61ee3
When I just use that category on it's own they do.
...?categoryId=4bf58dd8d48988d1d8941735&ll=47.6097,-122.3331&radius=10000&intent=browse&v=20120801
I have tried re-arranging the categories. I'd really like to avoid having to call the API many times with various categories.
Has anyone else seen this happen?
Your problem is with the location. The ll param you provided is for a location in San Francisco, but the venue you expect to appear is located in Seattle.
you can increase limit upto 100
I have done that and radius upto 100000meters(100km)
Related
Need help, I have an azure index called customer and have two fields in it customers & contacts, I have applied boost function for both the fields with boost 100 & 90, the problem is when I search any text it returns customer related relevance first and then contacts relevance.
Eg: If I search for "Johnson"
It will return all the customer details with Johnson first and then contact details even if the contact name matches "Johnson"
List of records displayed.
Record 1: This is customer
Johnson & tyson
Segment: Enterprise | Vertical: Healthcare | Country: US
Record 2: This is contact however it is associated with customer "Johnson and tyson"
Michael Walton
Customer:Johnson and tyson | Segment: Enterprise | Vertical: Pharmaceutical
Record 3: This is contact however it is associated with customer "Johnson and tyson"
Henri Vliegen
Customer:Johnson and tyson | Segment: Ent | Vertical: Pharmaceutical
Record 4: This is contact it is associated with customer "WST"
Henri Johnson
Customer:WST | Segment: Enterprise | Vertical: Pharmaceutical
So in this way records are displayed its most probably on scoring however I want the relevance name
to be displayed first like record 4 is contact and it should have been in place of record 2 since Johnson is the last name
I believe that it's because you're boosting with the same values, so it's like this:
if(Customer.Contains("Johnson") || (Contact.Contais("Johnson"))
{
//display
}
//PS: this statement is just to clarify that Contact and Customer name have the same importance.
Try to boost with different values, and I believe it will work. (100 for Customer and 90 for Details).
UPDATE
It seems that you are indexing first and last name separately. If you have a field "fullname" and boost through it, probably you'll get the expected result. Another option is create a scoring profile using those fields:
https://azure.microsoft.com/en-us/documentation/articles/search-get-started-scoring-profiles/
I read the question several times. While the question mentions that you have one index, the records displayed imply that you actually have two search indexes. Is this correct? I've been working on a training course for Azure Search, which discusses indexes and scoring in-depth.
At this time, Azure Search does not support cross-index queries. For that reason, if my understanding of your problem is correct, you'd have to run two queries: The first on the Customer index and the second on the Contacts index. Part of the reason that Azure Search is able to execute searches so quickly is because its a flattened out data structure, which allows for fast look-ups and queries. However, you're scenario implies something relational.
Am I misunderstanding your question?
we are configuring solr for an e-commerce site which features a range of products across multiple categories and brands. In addition to that there is also a number of landing pages which can be reached through the search. So overall, we have 4 types of possible results, I'll use an electronics site as an example:
Categories (i.e. "Smartphones")
Brands (i.e. "Samsung"
Products (i.e. "Samsung Galaxy S4")
Pages (i.e. "How-To Guide to your Samsung")
What we would like solr to do is
a) show those things in autosuggest (right now it shows the first three, but doesn't show pages as they aren't part of the product catalog through which it searches)
b) show the "type" of the result in the box next to the result. To illustrate, if I would type "Sam", the autosuggest box would look something like this:
Samsung Brand
Samsung Galaxy S4 Product
Samsung Galaxy S5 Product
How-To Guide to your Samsung Page
Android Smartphones Category
Particularly the last point is really important and we couldn't find any way to do this yet. Any help would be greatly appreciated.
You can create a separate core for all the stuff you want to be able to auto complete on, where you keep both the type and the value. That way you get the flexibility of adding new auto complete features later, and you'll avoid introducing a wide set of different documents in your main core.
Another option is to add a type field to your main schema, and create documents for Page objects as well (depending on how you create the existing auto complete categories - if you have three different types of documents in the index already, it would be quick to add a new field that just contains the type of the document as well).
We have a website where users put up ads for stuff they want to sell, with parameters such as price, location, title and description. These can then be searched for using sphinx and allowing users to specify min- and maxprice, a location with a searchradius (using google maps) etc. Users can choose to save these searches and get emails when new ads appear that fit their search. Herein lies the problem: We want to perform a reverse search every time an ad is posted. With the price, location, title and description as parameters we want to search through all the saved "searches" and get the ones that would have found the ad. The min- and maxprice should just be performed in a query i suppose, and some Quorom syntax to get all ads with at least 2 or mby just 1 occurance in the title/description. Our problem lies mostly in the geo-search. How do we find all searches where the "search-circles" would include our newly posted location without performing a search for every saved search?
That is the main-question, any comment on our suggested solution to the other problems is also very welcome. Thank you in advance / Jenny
The standard 'geo-search' support on sphinx should work just as well on a Prospective Index, as a normal retrospective search.
Having built a sphinx 'index' of all the saved searches...
And you run a query using the 'ad' as the search query:- rather than the 'filter' using a fixed radius, you just use the radius from the attribute (ie the radius stored on the particular query) - if using the API cant use setFilterRange directly, need to use setSelect, to make a new virtual attribute.
$cl->setSelect("*,IF(#geodist<radius,1,0) as myfilter");
$cl->setFilter('myfilter',array(1));
(and yes, the min/maxprice can just be done with normal filters too - just inverting the logic to that you would use in a retrospective search)
... the complication is in the 'full-text' query, if the saved search is anything more than a single keyword, but you appear to have already figured out that part.
We are planning to use foursquare api to get venue in a particular city. I want data of all the food outlets in a particular city. I have managed to get the categories list but not sure how to get venues from that particular category in a particular city or area.
Please share some tutorials or document which i can check out.
One way of doing what you want will be using the Venues Platform for browsing according to a category ID.
Look at venue search API reference.
Example of using it:
I know that 4bf58dd8d48988d11f941735 is nightlife (just picked the first one I saw)
So I will call the API (the ll is someplace in New York):
https://api.foursquare.com/v2/venues/search?ll=40.7268,-73.9972&categoryId=4bf58dd8d48988d11f941735&limit=50&intent=browse&radius=1500&your ids/oauth
Or use the explorer to see results right away.
Important, read the search API and the parameters used here to alter behavior to your needs.
Another very important thing, the API parameters are case sensitive!! (so if they want categoryId, categoryid will not work :) )
Tonight in my daily tech Googling I came across couchDB, after seeing tons of presentations about how it perform ten to hundred times better then any RDBM, how it would save us from SQL languages, tables, primary keys and so much more. I decided myself to try it myself. Only problem it seems I am unable to figure out how it works.
Like for a start I would like to code a web contact manager using couchDB. The project would enable user to do basic stuff like
Create/ Edit / Delete contacts
see a list of their contact ordered
search them on various criteria
So how do I start ?
Here some of my thoughts
create a database per user like July, Ann
in those DB, add some document with type contact, the document would look like this at first place see code 1
create / edit / delete is straight forward just need to do the PUT, POST, DELETE in the good database
searching would be handled by couchdb-lucene like dnolen suggested
now here come the difficult part, I don't really understand the whole map/reduce concept and how I can use that to do the jobs I used to do with SQL. Also with views how do you handle paging, also grouping.
I would like to build a screen with a paging set of links something like this
John, Doe
Johny, Hallyday
Jon, Skeet
A B C D E F **J** etc .... <-- those are link to see persons with that first name
what view should I create to achieve that, if you can provide samples it would wonderful.
Contact document.
{
type: 'contact',
firstname: 'firstname',
lastname: 'lastname',
email: ['home': 'foobar#foobar.net', 'work': 'foobar#foobar-working.net'],
phone: ['home': '+81 00 0000 0000'],
address: []
... some other fields maybe ...
}
The upcoming book by O'Reilly is free to read online:
http://books.couchdb.org/relax/
Just install and play around - you can do straight http requests using curl on the command line, or use the built-in web interface called futon.
Storing and retrieving data is really easy, the hardest part is thinking in terms of map/reduce-views instead of sql queries.
IBM has a great tutorial, making use of curl to read/write via the REST interface.
Your application is quite easy to do with CouchDB. You would have a database per user. Contacts are simply documents in a particular user's database. CRUD is just talking to the database using HTTP. You could create views that emit keys (last name, first name) to allow for sorting.
For powerful search I would recommend couchdb-lucene.