On Thu, Nov 12, 2009 at 3:39 PM, Chris Hostetter <hossman_luc...@fucit.org>wrote:
> > : I am getting results from one query and I just need 2 index attribute > values > : . These index attribute values are used for form new Query to Solr. > > can you elaborate on what exactly you mean by "These index attribute > values are used for form new Query to Solr" ... are you saying that you > want to take the values from *every* document matching query#1 and use > them to construct query#2 > > this sounds like you arent' denormalizing your data enough when building > your index. > > : Since Solr gives result only for GET request, hence there is restriction > on > : : forming query with all values. > > that's false ... you can post a query if you want, and there are not hard > constraints on how big a query can be (just practical constraints on what > your physical hardware can handle in a reasonable amount of time) > > : >> > SELECT id, first_name > : >> > FROM student_details > : >> > WHERE first_name IN (SELECT first_name > : >> > FROM student_details > : >> > WHERE subject= 'Science'); > : >> > > : >> > If so, how performant is this kind of queries? > > even as a sql query this doesn't relaly make much sense to me (at least > not w/o a better understanding of the table+data) > > why wouldn't you just say: > > SELECT id, first_name FROM ...WHERE subject='Science' > > ..or in Solr... > > q=subject:Science&fl=id,first_name > > > > -Hoss > > It's also important to note that the Solr schema contains only one "table", so to speak; whereas in the traditional database schema you can have more than one table in the same schema where you can do JOINs and sub queries across multiple tables to retrieve the target data. If you are bringing data from multiple database tables into the Solr index, they have to be denormalized to fit into just one "table" in Solr. So you will have to use a BOOLEAN AND or a filter query to simulate the sub query you are trying to make. I hope this clears things a bit. -- "Good Enough" is not good enough. To give anything less than your best is to sacrifice the gift. Quality First. Measure Twice. Cut Once.