Adelin
Adelin

Reputation: 18931

What is the best way to search within datastore entities?

I am building a website similar to yellow pages were users or visitors can search for registered companies. My website uses GAE datastore to store Companies information. I am a bit confused about the way, the API or the mechanism which I will use to implement something like full text search with my website. I will give you an example: suppose we have 3 companies

  1. name: name11, Address: address11, Activity: activity11.
  2. name: bla bla co. , Address: USE Chicago ... , Activity: house serving.
  3. name: some other Ltd, Address: Bulgaria, Activity: Software development.

and I have a search bar and the user enter the following text: house serving bulgaria name11.

  1. What is the best way to save Company entities, so that I can get information easy when search?
  2. What is the best mechanism to search my companies properties?
  3. I also want to look into some long text within companies profiles like some description or something.

Upvotes: 3

Views: 1311

Answers (1)

schuppe
schuppe

Reputation: 2033

You should use full-text search for this. The alternative, datastore, will be too inflexible and expensive (code-wise and penny-wise) to maintain.

I saw that you are concerned about full-text search being experimental, but it is unlikely that is will see major changes to the API in the future. I don't know about future pricing, but I think implementing a similarly functional feature with datastore won't be cheaper (indexes will cost you, in-memory searches will cost you instance time)

Upvotes: 5

Related Questions