You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Erik Holstad <er...@gmail.com> on 2008/09/03 02:20:26 UTC

Building a multilevel query.

Hi!
I want to do a query that first queries on one specific field and
for all those that match the input do a second query.

For example if we have a "type" field where one of the options
is "user" and a "title" fields includes the names of the users.

So I want to find all data with "type" field = user where the name
Erik is in the title field.

Is this possible? Have been playing with faceting, but can't get
the facet.query to work, and otherwise I just get all the results.

Regards Erik

Re: Building a multilevel query.

Posted by Chris Hostetter <ho...@fucit.org>.
: I want to do a query that first queries on one specific field and
: for all those that match the input do a second query.
: 
: For example if we have a "type" field where one of the options
: is "user" and a "title" fields includes the names of the users.
: 
: So I want to find all data with "type" field = user where the name
: Erik is in the title field.

I suspect i must be misunderstanding your question, because it sounds like 
you just want...

	...?q=title:Erik&fq=type:user


-Hoss


Re: Building a multilevel query.

Posted by Matthew Runo <mr...@zappos.com>.
I think in order to do this you'd need to run two queries. We do this  
as well, for example..

Facet on the product types that match a query term.
For each product type, run another query to facet on the subcategories.

Thanks for your time!

Matthew Runo
Software Engineer, Zappos.com
mruno@zappos.com - 702-943-7833

On Sep 2, 2008, at 5:20 PM, Erik Holstad wrote:

> Hi!
> I want to do a query that first queries on one specific field and
> for all those that match the input do a second query.
>
> For example if we have a "type" field where one of the options
> is "user" and a "title" fields includes the names of the users.
>
> So I want to find all data with "type" field = user where the name
> Erik is in the title field.
>
> Is this possible? Have been playing with faceting, but can't get
> the facet.query to work, and otherwise I just get all the results.
>
> Regards Erik