Ranged facet fields with underscores: how to?

76 views
Skip to first unread message

Richard Jones

unread,
Jun 26, 2011, 5:43:35 PM6/26/11
to solrpy
Hi Folks,

I'm trying to pass through solrpy a ranged facet search, which looks
like this in the url space:

facet.range=journal_count&f.journal_count.facet.range.start=0&f.journal_count.facet.range.end=60&f.journal_count.facet.range.gap=2

As you can see, the field in the index is "journal_count", which
contains an underscore.

When I pass this into the solrpy select method, I have to give it:

s.select(facet_range="journal_count",
f_journal_count_facet_range_start=0,
f_journal_count_facet_range_end=60, f_journal_count_facet_range_gap=2)

Which translates to the request:

facet.range=journal_count&f.journal.count.facet.range.start=0&f.journal.count.facet.range.end=60&f.journal.count.facet.range.gap=2

Which obviously throws an error because the _'s have been converted
to .'s, even in the field name (journal_count => journal.count).

What is the mechanism in solrpy for bypassing this issue? It looks
like raw() suffers the same issues; can I pass in a url fragment or
something?

Cheers,

Richard

Richard Jones

unread,
Jun 27, 2011, 4:20:23 AM6/27/11
to solrpy
Hi Folks,

Looking at this, it doesn't appear to have a workaround in solrpy, so
I have written a patch which fixes the problem for me. I've raised an
issue here, and attached the patch:

http://code.google.com/p/solrpy/issues/detail?id=28

Cheers,

Richard

Dariusz Suchojad

unread,
Jun 27, 2011, 10:56:11 AM6/27/11
to sol...@googlegroups.com
Richard Jones wrote:

> Looking at this, it doesn't appear to have a workaround in solrpy, so
> I have written a patch which fixes the problem for me. I've raised an
> issue here, and attached the patch:
>
> http://code.google.com/p/solrpy/issues/detail?id=28

The patch looks just fine and I'll push it to the repo soon if no one
objects.

thanks,

--
Dariusz Suchojad

Richard Jones

unread,
Jun 30, 2011, 1:33:01 PM6/30/11
to solrpy
Great, thanks. I'm currently working with solrpy to do a number of
more complex faceting jobs, so I'll let you have any more feedback
that I have on it.

Do you have a timeline for a 0.9.5 release? It would be good to know
when I can tell people on my project when they can make this work by
just easy_installing solrpy.

Cheers,

Richard

Dariusz Suchojad

unread,
Jul 1, 2011, 9:53:45 AM7/1/11
to sol...@googlegroups.com, Richard Jones
Richard Jones wrote:
> Great, thanks. I'm currently working with solrpy to do a number of
> more complex faceting jobs, so I'll let you have any more feedback
> that I have on it.

Sure, that's greatly appreciated!

> Do you have a timeline for a 0.9.5 release? It would be good to know
> when I can tell people on my project when they can make this work by
> just easy_installing solrpy.

Not sure if you're asking me directly as I'm merely a developer who's
just pushed your changes (thanks again!) but if using pip instead of
easy_install is an option you could do something like here

$ sudo pip install -e hg+https://solrpy.googlecode.com/hg/#egg=solrpy

As for releasing 0.9.5 - can any of the project's owners speak out?

cheers,

--
Dariusz Suchojad

Richard Jones

unread,
Jul 1, 2011, 12:27:12 PM7/1/11
to Dariusz Suchojad, sol...@googlegroups.com
Hi Darius

On Fri, Jul 1, 2011 at 2:53 PM, Dariusz Suchojad <ds...@gefira.pl> wrote:
> Richard Jones wrote:
>>
>> Great, thanks.  I'm currently working with solrpy to do a number of
>> more complex faceting jobs, so I'll let you have any more feedback
>> that I have on it.
>
> Sure, that's greatly appreciated!
>
>> Do you have a timeline for a 0.9.5 release?  It would be good to know
>> when I can tell people on my project when they can make this work by
>> just easy_installing solrpy.
>
> Not sure if you're asking me directly as I'm merely a developer who's just
> pushed your changes (thanks again!) but if using pip instead of easy_install
> is an option you could do something like here
>
> $ sudo pip install -e hg+https://solrpy.googlecode.com/hg/#egg=solrpy

Ah, sorry, I assumed you were in charge :)

Good tip re pip, I'll pass that along. Thanks for pushing my patch
into the main repo.

Cheers,

Richard

Reply all
Reply to author
Forward
0 new messages