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 a sd <li...@gmail.com> on 2012/04/11 12:52:51 UTC

How to get a list of values of a specified field

hi,all.
      I want to get all values of a specified field,  this field is type of
"solr.string".
      I can achieve this object by using "facet" feature, but there is a
trouble : it respond me the all values by the default "facet" query. If
there are millions of values with a field ,or more, it is a disaster to
the application.  I thought, was there a way  by which i can account the
amount of values at first, and then i query a segment of values by
specified the "facet.offset" and "facet.limit" iteratively?
     Thanks for your attention.
     B.R.
murphy

Re: How to get a list of values of a specified field

Posted by a sd <li...@gmail.com>.
I know,i know, This is a very expensive operation,the requirement  is also
very odd ,but is also very real. It is actually desired to go through the
whole documents within lucene again and again.
List the all potential value of a specified, and then divide the all work
(to go through) into a series of sub jobs by the variant field values. this
is my original intention.
By the way,I had a suggestion: can solr/lucene expose some class/interface
"public"? I had study the src of ( lucene/solr), i found some  utilities is
convenient to fulfill my required, but it is sad that they are  all access
modifier with private,protected or default.
B.R.
murphy

On Wed, Apr 11, 2012 at 11:59 PM, Erick Erickson <er...@gmail.com>wrote:

> Consider using the TermsComponent
> (http://wiki.apache.org/solr/TermsComponent)
> You could get some number of terms from
> your field at a time by judicious use of, say,
> facet.prefix if you wanted.
>
> But why do you want to do this? It's kind of an
> odd requirement, and since you say there are
> millions of values this will be expensive....
>
> Best
> Erick
>
> On Wed, Apr 11, 2012 at 7:23 AM, a sd <li...@gmail.com> wrote:
> > The type of content is "solr.string", actually is a sequence of any
> > characters,"_",number,etc.
> >
> > On Wed, Apr 11, 2012 at 7:06 PM, Marcelo Carvalho Fernandes <
> > mcf2000@gmail.com> wrote:
> >
> >> What type of content do you have in this field?
> >>
> >> ---
> >> Marcelo Carvalho Fernandes
> >>
> >> On Wednesday, April 11, 2012, a sd <li...@gmail.com> wrote:
> >> > hi,all.
> >> >      I want to get all values of a specified field,  this field is
> type
> >> of
> >> > "solr.string".
> >> >      I can achieve this object by using "facet" feature, but there is
> a
> >> > trouble : it respond me the all values by the default "facet" query.
> If
> >> > there are millions of values with a field ,or more, it is a disaster
> to
> >> > the application.  I thought, was there a way  by which i can account
> the
> >> > amount of values at first, and then i query a segment of values by
> >> > specified the "facet.offset" and "facet.limit" iteratively?
> >> >     Thanks for your attention.
> >> >     B.R.
> >> > murphy
> >> >
> >>
> >> --
> >> ----
> >> Marcelo Carvalho Fernandes
> >> +55 21 8272-7970
> >> +55 21 2205-2786
> >>
>

Re: How to get a list of values of a specified field

Posted by Erick Erickson <er...@gmail.com>.
Consider using the TermsComponent
(http://wiki.apache.org/solr/TermsComponent)
You could get some number of terms from
your field at a time by judicious use of, say,
facet.prefix if you wanted.

But why do you want to do this? It's kind of an
odd requirement, and since you say there are
millions of values this will be expensive....

Best
Erick

On Wed, Apr 11, 2012 at 7:23 AM, a sd <li...@gmail.com> wrote:
> The type of content is "solr.string", actually is a sequence of any
> characters,"_",number,etc.
>
> On Wed, Apr 11, 2012 at 7:06 PM, Marcelo Carvalho Fernandes <
> mcf2000@gmail.com> wrote:
>
>> What type of content do you have in this field?
>>
>> ---
>> Marcelo Carvalho Fernandes
>>
>> On Wednesday, April 11, 2012, a sd <li...@gmail.com> wrote:
>> > hi,all.
>> >      I want to get all values of a specified field,  this field is type
>> of
>> > "solr.string".
>> >      I can achieve this object by using "facet" feature, but there is a
>> > trouble : it respond me the all values by the default "facet" query. If
>> > there are millions of values with a field ,or more, it is a disaster to
>> > the application.  I thought, was there a way  by which i can account the
>> > amount of values at first, and then i query a segment of values by
>> > specified the "facet.offset" and "facet.limit" iteratively?
>> >     Thanks for your attention.
>> >     B.R.
>> > murphy
>> >
>>
>> --
>> ----
>> Marcelo Carvalho Fernandes
>> +55 21 8272-7970
>> +55 21 2205-2786
>>

Re: How to get a list of values of a specified field

Posted by a sd <li...@gmail.com>.
The type of content is "solr.string", actually is a sequence of any
characters,"_",number,etc.

On Wed, Apr 11, 2012 at 7:06 PM, Marcelo Carvalho Fernandes <
mcf2000@gmail.com> wrote:

> What type of content do you have in this field?
>
> ---
> Marcelo Carvalho Fernandes
>
> On Wednesday, April 11, 2012, a sd <li...@gmail.com> wrote:
> > hi,all.
> >      I want to get all values of a specified field,  this field is type
> of
> > "solr.string".
> >      I can achieve this object by using "facet" feature, but there is a
> > trouble : it respond me the all values by the default "facet" query. If
> > there are millions of values with a field ,or more, it is a disaster to
> > the application.  I thought, was there a way  by which i can account the
> > amount of values at first, and then i query a segment of values by
> > specified the "facet.offset" and "facet.limit" iteratively?
> >     Thanks for your attention.
> >     B.R.
> > murphy
> >
>
> --
> ----
> Marcelo Carvalho Fernandes
> +55 21 8272-7970
> +55 21 2205-2786
>

Re: How to get a list of values of a specified field

Posted by Marcelo Carvalho Fernandes <mc...@gmail.com>.
What type of content do you have in this field?

---
Marcelo Carvalho Fernandes

On Wednesday, April 11, 2012, a sd <li...@gmail.com> wrote:
> hi,all.
>      I want to get all values of a specified field,  this field is type of
> "solr.string".
>      I can achieve this object by using "facet" feature, but there is a
> trouble : it respond me the all values by the default "facet" query. If
> there are millions of values with a field ,or more, it is a disaster to
> the application.  I thought, was there a way  by which i can account the
> amount of values at first, and then i query a segment of values by
> specified the "facet.offset" and "facet.limit" iteratively?
>     Thanks for your attention.
>     B.R.
> murphy
>

-- 
----
Marcelo Carvalho Fernandes
+55 21 8272-7970
+55 21 2205-2786