What is xml based keyword search?

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

Was this solution helpful to you?

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

Find solution

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.