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 Dave Seltzer <ds...@tveyes.com> on 2013/11/27 17:22:49 UTC
What is the right way to list top terms for a given field?
Hello,
I'm trying to get a list of top terms for a field called "Tags".
One way to do this would be to query all data *:* and then facet by the
Tags column:
/solr/collection/admin/select?q=*:*&rows=0&facet=true&facet.field=Tags
I've noticed another way to do this is using the luke interface like this:
/solr/collection/admin/luke?fl=Tags&numTerms=20
One problem I see with the luke interface is that its inside the /admin/
path, which to me means that my users shouldn't be able to access it.
Whats the most SOLRy way to do this?
Thanks!
-D
Re: What is the right way to list top terms for a given field?
Posted by Dave Seltzer <ds...@tveyes.com>.
Thanks Tim,
That seems to be exactly what I'm looking for!
-Dave
> On Nov 27, 2013, at 2:34 PM, Timothy Potter <th...@gmail.com> wrote:
>
> Hi Dave,
>
> Have you looked at the TermsComponent?
> http://wiki.apache.org/solr/TermsComponent It is easy to wire into an
> existing request handler and allows you to return the top terms for a
> field. Example server even includes an example request handler that
> uses it:
>
> <searchComponent name="terms" class="solr.TermsComponent"/>
>
> <requestHandler name="/terms" class="solr.SearchHandler" startup="lazy">
> <lst name="defaults">
> <bool name="terms">true</bool>
> <bool name="distrib">false</bool>
> </lst>
> <arr name="components">
> <str>terms</str>
> </arr>
> </requestHandler>
>
> Cheers,
> Tim
>
>> On Wed, Nov 27, 2013 at 10:07 AM, Dave Seltzer <ds...@tveyes.com> wrote:
>> It's certainly seems to be faster (in my limited testing).
>>
>> I just don't want to base my software on the Luke scripts if they're
>> prone to changing in the future.
>>
>> And yes, I realize there are ways to make this secure. I just wanted
>> to know if it's something I should avoid doing (perhaps for reasons
>> beyond my comprehension.)
>>
>> Thanks!
>>
>> -D
>>
>>> On Nov 27, 2013, at 11:46 AM, Stefan Matheis <ma...@gmail.com> wrote:
>>>
>>> Since your users shouldn't be allowed at any time to access Solr directly, it's up to you to implement that on the client side anyway?
>>>
>>> I can't tell if there is a technical difference between the two calls you named, but i'd guess that the second might be a more direct way to access this information (and probably a bit faster?).
>>>
>>> -Stefan
>>>
>>>
>>>> On Wednesday, November 27, 2013 at 5:22 PM, Dave Seltzer wrote:
>>>>
>>>> Hello,
>>>>
>>>> I'm trying to get a list of top terms for a field called "Tags".
>>>>
>>>> One way to do this would be to query all data *:* and then facet by the
>>>> Tags column:
>>>> /solr/collection/admin/select?q=*:*&rows=0&facet=true&facet.field=Tags
>>>>
>>>> I've noticed another way to do this is using the luke interface like this:
>>>> /solr/collection/admin/luke?fl=Tags&numTerms=20
>>>>
>>>> One problem I see with the luke interface is that its inside the /admin/
>>>> path, which to me means that my users shouldn't be able to access it.
>>>>
>>>> Whats the most SOLRy way to do this?
>>>>
>>>> Thanks!
>>>>
>>>> -D
>>>
Re: What is the right way to list top terms for a given field?
Posted by Timothy Potter <th...@gmail.com>.
Hi Dave,
Have you looked at the TermsComponent?
http://wiki.apache.org/solr/TermsComponent It is easy to wire into an
existing request handler and allows you to return the top terms for a
field. Example server even includes an example request handler that
uses it:
<searchComponent name="terms" class="solr.TermsComponent"/>
<requestHandler name="/terms" class="solr.SearchHandler" startup="lazy">
<lst name="defaults">
<bool name="terms">true</bool>
<bool name="distrib">false</bool>
</lst>
<arr name="components">
<str>terms</str>
</arr>
</requestHandler>
Cheers,
Tim
On Wed, Nov 27, 2013 at 10:07 AM, Dave Seltzer <ds...@tveyes.com> wrote:
> It's certainly seems to be faster (in my limited testing).
>
> I just don't want to base my software on the Luke scripts if they're
> prone to changing in the future.
>
> And yes, I realize there are ways to make this secure. I just wanted
> to know if it's something I should avoid doing (perhaps for reasons
> beyond my comprehension.)
>
> Thanks!
>
> -D
>
>> On Nov 27, 2013, at 11:46 AM, Stefan Matheis <ma...@gmail.com> wrote:
>>
>> Since your users shouldn't be allowed at any time to access Solr directly, it's up to you to implement that on the client side anyway?
>>
>> I can't tell if there is a technical difference between the two calls you named, but i'd guess that the second might be a more direct way to access this information (and probably a bit faster?).
>>
>> -Stefan
>>
>>
>>> On Wednesday, November 27, 2013 at 5:22 PM, Dave Seltzer wrote:
>>>
>>> Hello,
>>>
>>> I'm trying to get a list of top terms for a field called "Tags".
>>>
>>> One way to do this would be to query all data *:* and then facet by the
>>> Tags column:
>>> /solr/collection/admin/select?q=*:*&rows=0&facet=true&facet.field=Tags
>>>
>>> I've noticed another way to do this is using the luke interface like this:
>>> /solr/collection/admin/luke?fl=Tags&numTerms=20
>>>
>>> One problem I see with the luke interface is that its inside the /admin/
>>> path, which to me means that my users shouldn't be able to access it.
>>>
>>> Whats the most SOLRy way to do this?
>>>
>>> Thanks!
>>>
>>> -D
>>
Re: What is the right way to list top terms for a given field?
Posted by Dave Seltzer <ds...@tveyes.com>.
It's certainly seems to be faster (in my limited testing).
I just don't want to base my software on the Luke scripts if they're
prone to changing in the future.
And yes, I realize there are ways to make this secure. I just wanted
to know if it's something I should avoid doing (perhaps for reasons
beyond my comprehension.)
Thanks!
-D
> On Nov 27, 2013, at 11:46 AM, Stefan Matheis <ma...@gmail.com> wrote:
>
> Since your users shouldn't be allowed at any time to access Solr directly, it's up to you to implement that on the client side anyway?
>
> I can't tell if there is a technical difference between the two calls you named, but i'd guess that the second might be a more direct way to access this information (and probably a bit faster?).
>
> -Stefan
>
>
>> On Wednesday, November 27, 2013 at 5:22 PM, Dave Seltzer wrote:
>>
>> Hello,
>>
>> I'm trying to get a list of top terms for a field called "Tags".
>>
>> One way to do this would be to query all data *:* and then facet by the
>> Tags column:
>> /solr/collection/admin/select?q=*:*&rows=0&facet=true&facet.field=Tags
>>
>> I've noticed another way to do this is using the luke interface like this:
>> /solr/collection/admin/luke?fl=Tags&numTerms=20
>>
>> One problem I see with the luke interface is that its inside the /admin/
>> path, which to me means that my users shouldn't be able to access it.
>>
>> Whats the most SOLRy way to do this?
>>
>> Thanks!
>>
>> -D
>
Re: What is the right way to list top terms for a given field?
Posted by Stefan Matheis <ma...@gmail.com>.
Since your users shouldn't be allowed at any time to access Solr directly, it's up to you to implement that on the client side anyway?
I can't tell if there is a technical difference between the two calls you named, but i'd guess that the second might be a more direct way to access this information (and probably a bit faster?).
-Stefan
On Wednesday, November 27, 2013 at 5:22 PM, Dave Seltzer wrote:
> Hello,
>
> I'm trying to get a list of top terms for a field called "Tags".
>
> One way to do this would be to query all data *:* and then facet by the
> Tags column:
> /solr/collection/admin/select?q=*:*&rows=0&facet=true&facet.field=Tags
>
> I've noticed another way to do this is using the luke interface like this:
> /solr/collection/admin/luke?fl=Tags&numTerms=20
>
> One problem I see with the luke interface is that its inside the /admin/
> path, which to me means that my users shouldn't be able to access it.
>
> Whats the most SOLRy way to do this?
>
> Thanks!
>
> -D
Re: What is the right way to list top terms for a given field?
Posted by Alexandre Rafalovitch <ar...@gmail.com>.
You can always expose the admin handler on non-admin URL. That's all just
definitions in solrconfig.xml.
Personal website: http://www.outerthoughts.com/
LinkedIn: http://www.linkedin.com/in/alexandrerafalovitch
- Time is the quality of nature that keeps events from happening all at
once. Lately, it doesn't seem to be working. (Anonymous - via GTD book)
On Wed, Nov 27, 2013 at 11:22 PM, Dave Seltzer <ds...@tveyes.com> wrote:
> Hello,
>
> I'm trying to get a list of top terms for a field called "Tags".
>
> One way to do this would be to query all data *:* and then facet by the
> Tags column:
> /solr/collection/admin/select?q=*:*&rows=0&facet=true&facet.field=Tags
>
> I've noticed another way to do this is using the luke interface like this:
> /solr/collection/admin/luke?fl=Tags&numTerms=20
>
> One problem I see with the luke interface is that its inside the /admin/
> path, which to me means that my users shouldn't be able to access it.
>
> Whats the most SOLRy way to do this?
>
> Thanks!
>
> -D
>