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 Sourajit Basak <so...@gmail.com> on 2013/06/23 14:52:55 UTC

edismax: date range facet with queries containing OR clause

When we have a user query like keyword1 OR keyword2, we can find the count
of each keyword using the following params.

q= keyword1 OR keyword2
facet.query=keyword1
facet.query=keyword2
facet=true

How do we do a date range facet that will return results for each keyword
faceted by date range ?

Re: edismax: date range facet with queries containing OR clause

Posted by Walter Underwood <wu...@wunderwood.org>.
You don't even need threads, async HTTP works just fine.

1. Send request A
2. Send request B
3. Wait for response A
4. Wait for response B

wunder

On Jun 23, 2013, at 7:41 AM, Jack Krupansky wrote:

> Do the requests in parallel (separate threads) and then the performance won't be impacted significantly.
> 
> -- Jack Krupansky
> 
> -----Original Message----- From: Sourajit Basak
> Sent: Sunday, June 23, 2013 10:23 AM
> To: solr-user@lucene.apache.org
> Subject: Re: edismax: date range facet with queries containing OR clause
> 
> Thats exactly how we are doing now. However, we need to offer the search
> over slow networks, hence was wondering if there's a way to reduce server
> round-trips.
> 
> 
> On Sun, Jun 23, 2013 at 7:14 PM, Jack Krupansky <ja...@basetechnology.com>wrote:
> 
>> Just do separate faceted query requests:
>> 
>> q= keyword1
>> facet.range=date_field_name
>> ...
>> facet=true
>> 
>> q= keyword2
>> facet.range=date_field_name
>> ...
>> facet=true
>> 
>> Where the "..." means fill in the additional facet.range.xxx parameters
>> (start, end, gap, etc.)
>> 
>> -- Jack Krupansky
>> 
>> -----Original Message----- From: Sourajit Basak
>> Sent: Sunday, June 23, 2013 8:52 AM
>> To: solr-user@lucene.apache.org
>> Subject: edismax: date range facet with queries containing OR clause
>> 
>> 
>> When we have a user query like keyword1 OR keyword2, we can find the count
>> of each keyword using the following params.
>> 
>> q= keyword1 OR keyword2
>> facet.query=keyword1
>> facet.query=keyword2
>> facet=true
>> 
>> How do we do a date range facet that will return results for each keyword
>> faceted by date range ?
> 

--
Walter Underwood
wunder@wunderwood.org




Re: edismax: date range facet with queries containing OR clause

Posted by Jack Krupansky <ja...@basetechnology.com>.
Do the requests in parallel (separate threads) and then the performance 
won't be impacted significantly.

-- Jack Krupansky

-----Original Message----- 
From: Sourajit Basak
Sent: Sunday, June 23, 2013 10:23 AM
To: solr-user@lucene.apache.org
Subject: Re: edismax: date range facet with queries containing OR clause

Thats exactly how we are doing now. However, we need to offer the search
over slow networks, hence was wondering if there's a way to reduce server
round-trips.


On Sun, Jun 23, 2013 at 7:14 PM, Jack Krupansky 
<ja...@basetechnology.com>wrote:

> Just do separate faceted query requests:
>
> q= keyword1
> facet.range=date_field_name
> ...
> facet=true
>
> q= keyword2
> facet.range=date_field_name
> ...
> facet=true
>
> Where the "..." means fill in the additional facet.range.xxx parameters
> (start, end, gap, etc.)
>
> -- Jack Krupansky
>
> -----Original Message----- From: Sourajit Basak
> Sent: Sunday, June 23, 2013 8:52 AM
> To: solr-user@lucene.apache.org
> Subject: edismax: date range facet with queries containing OR clause
>
>
> When we have a user query like keyword1 OR keyword2, we can find the count
> of each keyword using the following params.
>
> q= keyword1 OR keyword2
> facet.query=keyword1
> facet.query=keyword2
> facet=true
>
> How do we do a date range facet that will return results for each keyword
> faceted by date range ?
> 


Re: edismax: date range facet with queries containing OR clause

Posted by Sourajit Basak <so...@gmail.com>.
We are using edismax; the keywords can be in any of the 'qf' fields
specified. Assume 'qf' to be a single fieldA, then the following doesn't
seem to make sense.

q=keyword1 OR keyword2
facet=true
facet.pivot=fieldA,date_field

The purpose is to display the count of the matches of keyword1 & keyword2
in fieldA over a range of dates.

Seems like this isn't possible.


On Sun, Jun 23, 2013 at 8:09 PM, Jack Krupansky <ja...@basetechnology.com>wrote:

> If your keywords are the value in some other field, then, yes, you can use
> facet pivots:
>
> facet.pivot=keyword_field,**date_field
>
> (See the example in the book! Or on the wiki.)
>
>
> -- Jack Krupansky
>
> -----Original Message----- From: Sourajit Basak
> Sent: Sunday, June 23, 2013 10:29 AM
> To: solr-user@lucene.apache.org
> Subject: Re: edismax: date range facet with queries containing OR clause
>
>
> Is there a way to write this query using pivots. Will try out and post
> here.
> Appreciate if someone points to a way.
>
>
>
>
> On Sun, Jun 23, 2013 at 7:53 PM, Sourajit Basak <so...@gmail.com>
> **wrote:
>
>  Thats exactly how we are doing now. However, we need to offer the search
>> over slow networks, hence was wondering if there's a way to reduce server
>> round-trips.
>>
>>
>> On Sun, Jun 23, 2013 at 7:14 PM, Jack Krupansky <ja...@basetechnology.com>
>> **wrote:
>>
>>  Just do separate faceted query requests:
>>>
>>> q= keyword1
>>> facet.range=date_field_name
>>> ...
>>> facet=true
>>>
>>> q= keyword2
>>> facet.range=date_field_name
>>> ...
>>> facet=true
>>>
>>> Where the "..." means fill in the additional facet.range.xxx parameters
>>> (start, end, gap, etc.)
>>>
>>> -- Jack Krupansky
>>>
>>> -----Original Message----- From: Sourajit Basak
>>> Sent: Sunday, June 23, 2013 8:52 AM
>>> To: solr-user@lucene.apache.org
>>> Subject: edismax: date range facet with queries containing OR clause
>>>
>>>
>>> When we have a user query like keyword1 OR keyword2, we can find the
>>> count
>>> of each keyword using the following params.
>>>
>>> q= keyword1 OR keyword2
>>> facet.query=keyword1
>>> facet.query=keyword2
>>> facet=true
>>>
>>> How do we do a date range facet that will return results for each keyword
>>> faceted by date range ?
>>>
>>>
>>
>>
>

Re: edismax: date range facet with queries containing OR clause

Posted by Jack Krupansky <ja...@basetechnology.com>.
If your keywords are the value in some other field, then, yes, you can use 
facet pivots:

facet.pivot=keyword_field,date_field

(See the example in the book! Or on the wiki.)

-- Jack Krupansky

-----Original Message----- 
From: Sourajit Basak
Sent: Sunday, June 23, 2013 10:29 AM
To: solr-user@lucene.apache.org
Subject: Re: edismax: date range facet with queries containing OR clause

Is there a way to write this query using pivots. Will try out and post here.
Appreciate if someone points to a way.




On Sun, Jun 23, 2013 at 7:53 PM, Sourajit Basak 
<so...@gmail.com>wrote:

> Thats exactly how we are doing now. However, we need to offer the search
> over slow networks, hence was wondering if there's a way to reduce server
> round-trips.
>
>
> On Sun, Jun 23, 2013 at 7:14 PM, Jack Krupansky 
> <ja...@basetechnology.com>wrote:
>
>> Just do separate faceted query requests:
>>
>> q= keyword1
>> facet.range=date_field_name
>> ...
>> facet=true
>>
>> q= keyword2
>> facet.range=date_field_name
>> ...
>> facet=true
>>
>> Where the "..." means fill in the additional facet.range.xxx parameters
>> (start, end, gap, etc.)
>>
>> -- Jack Krupansky
>>
>> -----Original Message----- From: Sourajit Basak
>> Sent: Sunday, June 23, 2013 8:52 AM
>> To: solr-user@lucene.apache.org
>> Subject: edismax: date range facet with queries containing OR clause
>>
>>
>> When we have a user query like keyword1 OR keyword2, we can find the 
>> count
>> of each keyword using the following params.
>>
>> q= keyword1 OR keyword2
>> facet.query=keyword1
>> facet.query=keyword2
>> facet=true
>>
>> How do we do a date range facet that will return results for each keyword
>> faceted by date range ?
>>
>
> 


Re: edismax: date range facet with queries containing OR clause

Posted by Sourajit Basak <so...@gmail.com>.
Is there a way to write this query using pivots. Will try out and post here.
Appreciate if someone points to a way.




On Sun, Jun 23, 2013 at 7:53 PM, Sourajit Basak <so...@gmail.com>wrote:

> Thats exactly how we are doing now. However, we need to offer the search
> over slow networks, hence was wondering if there's a way to reduce server
> round-trips.
>
>
> On Sun, Jun 23, 2013 at 7:14 PM, Jack Krupansky <ja...@basetechnology.com>wrote:
>
>> Just do separate faceted query requests:
>>
>> q= keyword1
>> facet.range=date_field_name
>> ...
>> facet=true
>>
>> q= keyword2
>> facet.range=date_field_name
>> ...
>> facet=true
>>
>> Where the "..." means fill in the additional facet.range.xxx parameters
>> (start, end, gap, etc.)
>>
>> -- Jack Krupansky
>>
>> -----Original Message----- From: Sourajit Basak
>> Sent: Sunday, June 23, 2013 8:52 AM
>> To: solr-user@lucene.apache.org
>> Subject: edismax: date range facet with queries containing OR clause
>>
>>
>> When we have a user query like keyword1 OR keyword2, we can find the count
>> of each keyword using the following params.
>>
>> q= keyword1 OR keyword2
>> facet.query=keyword1
>> facet.query=keyword2
>> facet=true
>>
>> How do we do a date range facet that will return results for each keyword
>> faceted by date range ?
>>
>
>

Re: edismax: date range facet with queries containing OR clause

Posted by Sourajit Basak <so...@gmail.com>.
Thats exactly how we are doing now. However, we need to offer the search
over slow networks, hence was wondering if there's a way to reduce server
round-trips.


On Sun, Jun 23, 2013 at 7:14 PM, Jack Krupansky <ja...@basetechnology.com>wrote:

> Just do separate faceted query requests:
>
> q= keyword1
> facet.range=date_field_name
> ...
> facet=true
>
> q= keyword2
> facet.range=date_field_name
> ...
> facet=true
>
> Where the "..." means fill in the additional facet.range.xxx parameters
> (start, end, gap, etc.)
>
> -- Jack Krupansky
>
> -----Original Message----- From: Sourajit Basak
> Sent: Sunday, June 23, 2013 8:52 AM
> To: solr-user@lucene.apache.org
> Subject: edismax: date range facet with queries containing OR clause
>
>
> When we have a user query like keyword1 OR keyword2, we can find the count
> of each keyword using the following params.
>
> q= keyword1 OR keyword2
> facet.query=keyword1
> facet.query=keyword2
> facet=true
>
> How do we do a date range facet that will return results for each keyword
> faceted by date range ?
>

Re: edismax: date range facet with queries containing OR clause

Posted by Jack Krupansky <ja...@basetechnology.com>.
Just do separate faceted query requests:

q= keyword1
facet.range=date_field_name
...
facet=true

q= keyword2
facet.range=date_field_name
...
facet=true

Where the "..." means fill in the additional facet.range.xxx parameters 
(start, end, gap, etc.)

-- Jack Krupansky

-----Original Message----- 
From: Sourajit Basak
Sent: Sunday, June 23, 2013 8:52 AM
To: solr-user@lucene.apache.org
Subject: edismax: date range facet with queries containing OR clause

When we have a user query like keyword1 OR keyword2, we can find the count
of each keyword using the following params.

q= keyword1 OR keyword2
facet.query=keyword1
facet.query=keyword2
facet=true

How do we do a date range facet that will return results for each keyword
faceted by date range ?