What type of search indexes and approach should be worked on for a website with city(&locality) based search for a keyword , a typical example is a web directory?
-
Answer:
A local search engine should support search both by keywords and by location. In addition to indexing every document by keywords according to its content, one should index its location (say lat/long pair) and maybe a city name. To keep the search efficient, one should filter based on the smaller set - documents matching the keywords or documents matching the geographical constraint (e.g. inside a circle of radius 5 km around me). Please see Patrick O'leary's explanation about Local Lucene [1], and 's paper about the same subject. [1] http://www.nsshutdown.com/projects/lucene/whitepaper/locallucene_v2.html [2] http://www.ibm.com/developerworks/opensource/library/j-spatial/ EDIT: Varun Jain suggested a different structure in his comment. Here is my reply: You refer to three tables: keywords, cities, distance. This is a relational database schema, which may be applicable here. Let me suggest a different schema, which I will describe in Lucene terminology: Store a single document per, say, shop or movie. Each document will have a city field, title and content field and a location (lat/long) field. When querying for Chinese restaurants in London, query the index for a match to city AND Chinese restaurant, something like: +city:London +title:Chinese restaurant Then sort the results by distance from your location. This is a single query in Lucene/Solr, rather than several joins in a database. I believe this is a more efficient solution. If you use a different search engine or roll your own, YMMV.
Yuval Feinstein at Quora Visit the source
Other answers
Google is working on creating a search api in their App Engine. This is still in experimental stage but definitely is going to have a huge impact in the near future. https://developers.google.com/appengine/docs/python/search/overview
Ujjal Bhattacharjee
Related Q & A:
- When i do a search and click on a result a get a page addressed rc10 overture what do i do?Best solution by Yahoo! Answers
- What is a website where there are live web shows?Best solution by Yahoo! Answers
- Is there a website where i can either download or play a program that will let me build a building, like?Best solution by Yahoo! Answers
- How long is a typical recovery from a thyroidectomy?Best solution by ChaCha
- Should i be a graphic designer or a web designer?Best solution by AllExperts
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.