Im using JPA in Google App Engine.
I have a profile entity with many properties, (e.g. from name to hobbies). I allow users to search for the profile entity. Properties for searching are optional. If users did not enter a value for a property, it is excluded in the query. So, different combinations of provided properties in searching will have different query as well.
The condition in the query is dynamic, it depends on the provided properties while a user is searching. I have something below for all the properties.
if( ! profile.getLocation().equals("") )
condition += " AND p.location = '" + profile.getLocation() + "' ";
The problem is that it requires a lot of indexing. What will be the other approach on this?
I think it will require hundreds of index for the different combination of properties provided.
Thanks.
You have to use an third part server like Solr or using the new (but experimental) Search API