Re: Are subqueries possible in Solr? If so, are they performant?

2009-11-12 Thread Israel Ekpo
On Thu, Nov 12, 2009 at 3:39 PM, Chris Hostetter
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.


Re: Are subqueries possible in Solr? If so, are they performant?

2009-11-12 Thread Chris Hostetter

: 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



Re: Are subqueries possible in Solr? If so, are they performant?

2009-11-10 Thread Otis Gospodnetic
No, I don't think you can do that with Solr.  Somebody will correct me if I'm 
wrong. :)

What you are describing are SQL sub-queries and the closest things I can think 
of are using AND as I mentioned, and maybe using filter queries (the "fq" 
parameter).


Otis 
--
Sematext is hiring -- http://sematext.com/about/jobs.html?mls
Lucene, Solr, Nutch, Katta, Hadoop, HBase, UIMA, NLP, NER, IR



- Original Message 
> From: Vicky_Dev 
> To: solr-user@lucene.apache.org
> Sent: Tue, November 10, 2009 1:23:07 AM
> Subject: Re: Are subqueries possible in Solr? If so, are they performant?
> 
> 
> Thanks Otis for your response.
> 
> Is it possible to get result of one solr query feed into another Solr Query?
> 
> Issue which I am facing right now is::
> 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. 
> 
> Since Solr gives result only for GET request, hence there is restriction on
> : forming query with all values.
> 
> Please do send your views on above problem
> 
> Thanks
> ~Vikrant
> 
> 
> 
> 
> Otis Gospodnetic wrote:
> > 
> > You can mimic them by combining 2 clauses with an AND.
> > e.g.
> > cookies
> > vs.
> > cookies AND vanilla
> > 
> > Otis
> > --
> > Sematext is hiring -- http://sematext.com/about/jobs.html?mls
> > Lucene, Solr, Nutch, Katta, Hadoop, HBase, UIMA, NLP, NER, IR
> > 
> > 
> > 
> > ----- Original Message 
> >> From: Vicky_Dev 
> >> To: solr-user@lucene.apache.org
> >> Sent: Mon, November 9, 2009 1:48:03 PM
> >> Subject: Re: Are subqueries possible in Solr? If so, are they performant?
> >> 
> >> 
> >> 
> >> Hi Team,
> >> Is it possible to write subqueries in dismaxrequest handler?
> >> 
> >> ~Vikrant
> >> 
> >> 
> >> Edoardo Marcora wrote:
> >> > 
> >> > Does Solr have the ability to do subqueries, like this one (in SQL):
> >> > 
> >> > 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?
> >> > 
> >> 
> >> -- 
> >> View this message in context: 
> >> 
> http://old.nabble.com/Are-subqueries-possible-in-Solr--If-so%2C-are-they-performant--tp24467023p26271600.html
> >> Sent from the Solr - User mailing list archive at Nabble.com.
> > 
> > 
> > 
> 
> -- 
> View this message in context: 
> http://old.nabble.com/Are-subqueries-possible-in-Solr--If-so%2C-are-they-performant--tp24467023p26278872.html
> Sent from the Solr - User mailing list archive at Nabble.com.



Re: Are subqueries possible in Solr? If so, are they performant?

2009-11-09 Thread Vicky_Dev

Thanks Otis for your response.

Is it possible to get result of one solr query feed into another Solr Query?

Issue which I am facing right now is::
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. 

Since Solr gives result only for GET request, hence there is restriction on
: forming query with all values.

Please do send your views on above problem

Thanks
~Vikrant




Otis Gospodnetic wrote:
> 
> You can mimic them by combining 2 clauses with an AND.
> e.g.
> cookies
> vs.
> cookies AND vanilla
> 
> Otis
> --
> Sematext is hiring -- http://sematext.com/about/jobs.html?mls
> Lucene, Solr, Nutch, Katta, Hadoop, HBase, UIMA, NLP, NER, IR
> 
> 
> 
> - Original Message 
>> From: Vicky_Dev 
>> To: solr-user@lucene.apache.org
>> Sent: Mon, November 9, 2009 1:48:03 PM
>> Subject: Re: Are subqueries possible in Solr? If so, are they performant?
>> 
>> 
>> 
>> Hi Team,
>> Is it possible to write subqueries in dismaxrequest handler?
>> 
>> ~Vikrant
>> 
>> 
>> Edoardo Marcora wrote:
>> > 
>> > Does Solr have the ability to do subqueries, like this one (in SQL):
>> > 
>> > 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?
>> > 
>> 
>> -- 
>> View this message in context: 
>> http://old.nabble.com/Are-subqueries-possible-in-Solr--If-so%2C-are-they-performant--tp24467023p26271600.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Are-subqueries-possible-in-Solr--If-so%2C-are-they-performant--tp24467023p26278875.html
Sent from the Solr - User mailing list archive at Nabble.com.



Re: Are subqueries possible in Solr? If so, are they performant?

2009-11-09 Thread Vicky_Dev

Thanks Otis for your response.

Is it possible to get result of one solr query feed into another Solr Query?

Issue which I am facing right now is::
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. 

Since Solr gives result only for GET request, hence there is restriction on
: forming query with all values.

Please do send your views on above problem

Thanks
~Vikrant




Otis Gospodnetic wrote:
> 
> You can mimic them by combining 2 clauses with an AND.
> e.g.
> cookies
> vs.
> cookies AND vanilla
> 
> Otis
> --
> Sematext is hiring -- http://sematext.com/about/jobs.html?mls
> Lucene, Solr, Nutch, Katta, Hadoop, HBase, UIMA, NLP, NER, IR
> 
> 
> 
> - Original Message 
>> From: Vicky_Dev 
>> To: solr-user@lucene.apache.org
>> Sent: Mon, November 9, 2009 1:48:03 PM
>> Subject: Re: Are subqueries possible in Solr? If so, are they performant?
>> 
>> 
>> 
>> Hi Team,
>> Is it possible to write subqueries in dismaxrequest handler?
>> 
>> ~Vikrant
>> 
>> 
>> Edoardo Marcora wrote:
>> > 
>> > Does Solr have the ability to do subqueries, like this one (in SQL):
>> > 
>> > 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?
>> > 
>> 
>> -- 
>> View this message in context: 
>> http://old.nabble.com/Are-subqueries-possible-in-Solr--If-so%2C-are-they-performant--tp24467023p26271600.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Are-subqueries-possible-in-Solr--If-so%2C-are-they-performant--tp24467023p26278872.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Are subqueries possible in Solr? If so, are they performant?

2009-11-09 Thread Otis Gospodnetic
You can mimic them by combining 2 clauses with an AND.
e.g.
cookies
vs.
cookies AND vanilla

Otis
--
Sematext is hiring -- http://sematext.com/about/jobs.html?mls
Lucene, Solr, Nutch, Katta, Hadoop, HBase, UIMA, NLP, NER, IR



- Original Message 
> From: Vicky_Dev 
> To: solr-user@lucene.apache.org
> Sent: Mon, November 9, 2009 1:48:03 PM
> Subject: Re: Are subqueries possible in Solr? If so, are they performant?
> 
> 
> 
> Hi Team,
> Is it possible to write subqueries in dismaxrequest handler?
> 
> ~Vikrant
> 
> 
> Edoardo Marcora wrote:
> > 
> > Does Solr have the ability to do subqueries, like this one (in SQL):
> > 
> > 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?
> > 
> 
> -- 
> View this message in context: 
> http://old.nabble.com/Are-subqueries-possible-in-Solr--If-so%2C-are-they-performant--tp24467023p26271600.html
> Sent from the Solr - User mailing list archive at Nabble.com.



Re: Are subqueries possible in Solr? If so, are they performant?

2009-11-09 Thread Vicky_Dev


Hi Team,
Is it possible to write subqueries in dismaxrequest handler?

~Vikrant


Edoardo Marcora wrote:
> 
> Does Solr have the ability to do subqueries, like this one (in SQL):
> 
> 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?
> 

-- 
View this message in context: 
http://old.nabble.com/Are-subqueries-possible-in-Solr--If-so%2C-are-they-performant--tp24467023p26271600.html
Sent from the Solr - User mailing list archive at Nabble.com.



Are subqueries possible in Solr? If so, are they performant?

2009-07-13 Thread Edoardo Marcora

Does Solr have the ability to do subqueries, like this one (in SQL):

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?
-- 
View this message in context: 
http://www.nabble.com/Are-subqueries-possible-in-Solr--If-so%2C-are-they-performant--tp24467023p24467023.html
Sent from the Solr - User mailing list archive at Nabble.com.