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 Rupert Bates <ru...@guardian.co.uk> on 2010/07/15 11:55:54 UTC

Query help

Hello, I hope someone can help me with this. I have a website which is
built on top of Solr and the home page is composed of 4 sections one
for each type of content on the site.

At the moment to populate this page, I am using 4 separate queries of the form:
?q=ContentType:News&sort=DatePublished+desc&start=0&rows=5
?q=ContentType:News&sort=Analysis+desc&start=0&rows=5
etc.
etc.

Can anyone think of a way I could reduce this to one query which
brings back the top 5 pieces of content for each content type by date?

Thanks in advance
Rupert



-- 
Rupert Bates

Software Development Manager
Guardian New and Media

Tel: 020 3353 3315
rupert.bates@guardian.co.uk
Please consider the environment before printing this email.
------------------------------------------------------------------
Visit guardian.co.uk - newspaper website of the year
www.guardian.co.uk  www.observer.co.uk

To save up to 33% when you subscribe to the Guardian and the Observer
visit http://www.guardian.co.uk/subscriber

The Guardian Public Services Awards 2010, in partnership with
Hays Specialist Recruitment, recognise and reward outstanding
performance from public, private and voluntary sector teams.

To find out more and to nominate a deserving team or individual, 
visit http://guardian.co.uk/publicservicesawards

Entries close 16 July.

---------------------------------------------------------------------

This e-mail and all attachments are confidential and may also
be privileged. If you are not the named recipient, please notify
the sender and delete the e-mail and all attachments immediately.
Do not disclose the contents to another person. You may not use
the information for any purpose, or store, or copy, it in any way.

Guardian News & Media Limited is not liable for any computer
viruses or other material transmitted with or as part of this
e-mail. You should employ virus checking software.

Guardian News & Media Limited
A member of Guardian Media Group PLC
Registered Office
Number 1 Scott Place, Manchester M3 3GG
Registered in England Number 908396


Re: Query help

Posted by Alejandro Marqués Rodríguez <am...@paradigmatecnologico.com>.
I can't see a way of retrieving five results from one type and five from
another in a single query. The only way I can think about that would have a
similar behaviour would be:

?q=ContentType:(News+OR+Analysis)&sort=DatePublished+desc&start=0&rows=10

This way you'll have the first 10 results being News or Analysis, though it
could be 7 News and 3 Analysis or even 10 and 0...

If you need Solr to return 5 results from each type, I think the only way to
improve the search speed would be, instead of using just one query, making
two parallel queries.

Regards


2010/7/15 Rupert Bates <ru...@guardian.co.uk>

> Sorry, my mistake, the example should have been as follows:
>
> ?q=ContentType:News&sort=DatePublished+desc&start=0&rows=5
> ?q=ContentType:Analysis&sort=DatePublished+desc&start=0&rows=5
>
> Rupert
>
> On 15 July 2010 13:02, kenf_nc <ke...@realestate.com> wrote:
> >
> > Your example though doesn't show different ContentType, it shows a
> different
> > sort order. That would be difficult to achieve in one call. Sounds like
> your
> > best bet is asynchronous (multi-threaded) calls if your architecture will
> > allow for it.
> > --
> > View this message in context:
> http://lucene.472066.n3.nabble.com/Query-help-tp969075p969334.html
> > Sent from the Solr - User mailing list archive at Nabble.com.
> >
>
>
>
> --
> Rupert Bates
>
> Software Development Manager
> Guardian News and Media
>
> Tel: 020 3353 3315
> rupert.bates@guardian.co.uk
> Please consider the environment before printing this email.
> ------------------------------------------------------------------
> Visit guardian.co.uk - newspaper website of the year
> www.guardian.co.uk  www.observer.co.uk
>
> To save up to 33% when you subscribe to the Guardian and the Observer
> visit http://www.guardian.co.uk/subscriber
>
> The Guardian Public Services Awards 2010, in partnership with
> Hays Specialist Recruitment, recognise and reward outstanding
> performance from public, private and voluntary sector teams.
>
> To find out more and to nominate a deserving team or individual,
> visit http://guardian.co.uk/publicservicesawards
>
> Entries close 16 July.
>
> ---------------------------------------------------------------------
>
> This e-mail and all attachments are confidential and may also
> be privileged. If you are not the named recipient, please notify
> the sender and delete the e-mail and all attachments immediately.
> Do not disclose the contents to another person. You may not use
> the information for any purpose, or store, or copy, it in any way.
>
> Guardian News & Media Limited is not liable for any computer
> viruses or other material transmitted with or as part of this
> e-mail. You should employ virus checking software.
>
> Guardian News & Media Limited
> A member of Guardian Media Group PLC
> Registered Office
> Number 1 Scott Place, Manchester M3 3GG
> Registered in England Number 908396
>
>


-- 
Alejandro Marqués Rodríguez

Paradigma Tecnológico
http://www.paradigmatecnologico.com
Avenida de Europa, 26. Ática 5. 3ª Planta
28224 Pozuelo de Alarcón
Tel.: 91 352 59 42

Re: Query help

Posted by Rupert Bates <ru...@guardian.co.uk>.
Sorry, my mistake, the example should have been as follows:

?q=ContentType:News&sort=DatePublished+desc&start=0&rows=5
?q=ContentType:Analysis&sort=DatePublished+desc&start=0&rows=5

Rupert

On 15 July 2010 13:02, kenf_nc <ke...@realestate.com> wrote:
>
> Your example though doesn't show different ContentType, it shows a different
> sort order. That would be difficult to achieve in one call. Sounds like your
> best bet is asynchronous (multi-threaded) calls if your architecture will
> allow for it.
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Query-help-tp969075p969334.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 
Rupert Bates

Software Development Manager
Guardian News and Media

Tel: 020 3353 3315
rupert.bates@guardian.co.uk
Please consider the environment before printing this email.
------------------------------------------------------------------
Visit guardian.co.uk - newspaper website of the year
www.guardian.co.uk  www.observer.co.uk

To save up to 33% when you subscribe to the Guardian and the Observer
visit http://www.guardian.co.uk/subscriber

The Guardian Public Services Awards 2010, in partnership with
Hays Specialist Recruitment, recognise and reward outstanding
performance from public, private and voluntary sector teams.

To find out more and to nominate a deserving team or individual, 
visit http://guardian.co.uk/publicservicesawards

Entries close 16 July.

---------------------------------------------------------------------

This e-mail and all attachments are confidential and may also
be privileged. If you are not the named recipient, please notify
the sender and delete the e-mail and all attachments immediately.
Do not disclose the contents to another person. You may not use
the information for any purpose, or store, or copy, it in any way.

Guardian News & Media Limited is not liable for any computer
viruses or other material transmitted with or as part of this
e-mail. You should employ virus checking software.

Guardian News & Media Limited
A member of Guardian Media Group PLC
Registered Office
Number 1 Scott Place, Manchester M3 3GG
Registered in England Number 908396


Re: Query help

Posted by kenf_nc <ke...@realestate.com>.
Your example though doesn't show different ContentType, it shows a different
sort order. That would be difficult to achieve in one call. Sounds like your
best bet is asynchronous (multi-threaded) calls if your architecture will
allow for it.
-- 
View this message in context: http://lucene.472066.n3.nabble.com/Query-help-tp969075p969334.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Spatial Search - Best choice ?

Posted by Chris Hostetter <ho...@fucit.org>.
: Subject: Spatial Search - Best choice ?
: In-Reply-To: <AA...@mail.gmail.com>
: References: <AA...@mail.gmail.com>

http://people.apache.org/~hossman/#threadhijack
Thread Hijacking on Mailing Lists

When starting a new discussion on a mailing list, please do not reply to 
an existing message, instead start a fresh email.  Even if you change the 
subject line of your email, other mail headers still track which thread 
you replied to and your question is "hidden" in that thread and gets less 
attention.   It makes following discussions in the mailing list archives 
particularly difficult.
See Also:  http://en.wikipedia.org/wiki/User:DonDiego/Thread_hijacking



-Hoss


Re: Spatial Search - Best choice ?

Posted by Saïd Radhouani <r....@gmail.com>.
Thanks for the links, but this makes things even harder :) Do you have any recommendations for one pointer over another?

Thanks,
-S


On Jul 15, 2010, at 1:08 PM, findbestopensource wrote:

> Some more pointers to spatial search,
> 
> http://www.jteam.nl/products/spatialsolrplugin.html
> http://code.google.com/p/spatial-search-lucene/
> http://sujitpal.blogspot.com/2008/02/spatial-search-with-lucene.html
> 
> Regards
> Aditya
> www.findbestopensource.com
> 
> 
> 
> On Thu, Jul 15, 2010 at 3:54 PM, Saïd Radhouani <r....@gmail.com>wrote:
> 
>> Hi,
>> 
>> Using Solr 1.4, I'm now working on adding spatial search options, such as
>> distance-based sorting, Bounding-box filter, etc.
>> 
>> To the best of my knowledge, there are three possible points we can start
>> from:
>> 
>> 1. The
>> http://blog.jteam.nl/2009/08/03/geo-location-search-with-solr-and-lucene/
>> 2. The gissearch.com
>> 3. The
>> http://www.ibm.com/developerworks/opensource/library/j-spatial/index.html#resources
>> 
>> I saw that these three options have been used but didn't see any comparison
>> between them. Is there any one out there who can recommend one option over
>> another?
>> 
>> Thanks,
>> -S


Re: Spatial Search - Best choice ?

Posted by findbestopensource <fi...@gmail.com>.
Some more pointers to spatial search,

http://www.jteam.nl/products/spatialsolrplugin.html
http://code.google.com/p/spatial-search-lucene/
http://sujitpal.blogspot.com/2008/02/spatial-search-with-lucene.html

Regards
Aditya
www.findbestopensource.com



On Thu, Jul 15, 2010 at 3:54 PM, Saïd Radhouani <r....@gmail.com>wrote:

> Hi,
>
> Using Solr 1.4, I'm now working on adding spatial search options, such as
> distance-based sorting, Bounding-box filter, etc.
>
> To the best of my knowledge, there are three possible points we can start
> from:
>
> 1. The
> http://blog.jteam.nl/2009/08/03/geo-location-search-with-solr-and-lucene/
> 2. The gissearch.com
> 3. The
> http://www.ibm.com/developerworks/opensource/library/j-spatial/index.html#resources
>
> I saw that these three options have been used but didn't see any comparison
> between them. Is there any one out there who can recommend one option over
> another?
>
> Thanks,
> -S

Spatial Search - Best choice ?

Posted by Saïd Radhouani <r....@gmail.com>.
Hi,

Using Solr 1.4, I'm now working on adding spatial search options, such as distance-based sorting, Bounding-box filter, etc.

To the best of my knowledge, there are three possible points we can start from: 

1. The http://blog.jteam.nl/2009/08/03/geo-location-search-with-solr-and-lucene/
2. The gissearch.com
3. The http://www.ibm.com/developerworks/opensource/library/j-spatial/index.html#resources 

I saw that these three options have been used but didn't see any comparison between them. Is there any one out there who can recommend one option over another? 

Thanks,
-S