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 Paul Terray <pt...@sollan.com> on 2006/06/07 09:45:55 UTC

List of indexed terms for a field

Hello, 

 

I am trying Solr for some projects and I am very impressed by its simplicity
and clarity of use.

 

I am trying to make an index: Is there any way to get a list of all indexed
terms for a field (especially a string or text one)?

 

Thanks.

 


> 

Paul Terray 


  

Consultant Avant-Vente


> 

SOLLAN

 


  

27, bis rue du Progrès 
93100 Montreuil - France
Tel :  +33 (0)1 48 51 15 44
Fax : +33 (0)1 48 51 15 48
 <ma...@sollan.com> pterray@sollan.com
 <http://www.sollan.com> www.sollan.com

STRICTLY PERSONAL AND CONFIDENTIAL. This email may contain confidential and
proprietary material for the sole use of the intended recipient. Any review
or distribution by others is strictly prohibited. If you are not the
intended recipient please contact the sender and delete all copies. 


 <http://www.sollan.com/signature_mail/lien_signature.php> SOLLAN

 


Re: List of indexed terms for a field

Posted by Tim Archambault <ta...@bangordailynews.net>.
Great question. Please share your answers. I'd like to use this for a
"GOOGLE SUGGEST" Ajax scenario.

On 6/7/06, Paul Terray <pt...@sollan.com> wrote:
>
> Hello,
>
>
>
> I am trying Solr for some projects and I am very impressed by its
> simplicity
> and clarity of use.
>
>
>
> I am trying to make an index: Is there any way to get a list of all
> indexed
> terms for a field (especially a string or text one)?
>
>
>
> Thanks.
>
>
>
>
> >
>
> Paul Terray
>
>
>
>
> Consultant Avant-Vente
>
>
> >
>
> SOLLAN
>
>
>
>
>
>
> 27, bis rue du Progrès
> 93100 Montreuil - France
> Tel :  +33 (0)1 48 51 15 44
> Fax : +33 (0)1 48 51 15 48
> <ma...@sollan.com> pterray@sollan.com
> <http://www.sollan.com> www.sollan.com
>
> STRICTLY PERSONAL AND CONFIDENTIAL. This email may contain confidential
> and
> proprietary material for the sole use of the intended recipient. Any
> review
> or distribution by others is strictly prohibited. If you are not the
> intended recipient please contact the sender and delete all copies.
>
>
> <http://www.sollan.com/signature_mail/lien_signature.php> SOLLAN
>
>
>
>
>

RE: List of indexed terms for a field

Posted by Paul Terray <pt...@sollan.com>.
Thanks for the answer.

This is not a need for the moment, but it could be in the near future. 

If it becomes so, I will see how we can implement such a thing.

As for the syntax, I would see another parameter for the request (and maybe
another URL, as the function is clearly different).

Something like:
http://localhost:8983/solr/terms/?fl=myfield&rows=10

But perhaps am I completely off-course (I am no Java developer, sorry).



-----Message d'origine-----
De : Yonik Seeley [mailto:yseeley@gmail.com] 
Envoyé : mercredi 7 juin 2006 15:41
À : solr-user@lucene.apache.org
Objet : Re: List of indexed terms for a field

On 6/7/06, Paul Terray <pt...@sollan.com> wrote:
> I am trying to make an index: Is there any way to get a list of all
indexed
> terms for a field (especially a string or text one)?

Hi Paul,
There isn't currently a way to do this, except perhaps writing your
own custom request handler and using the lower level Lucene
TermEnumerator after getting your hands on the underlying IndexReader.

This feature has been on my wish-list though.
There needs to be a syntax to request info like this, and then the
implementation.

perhaps something along the lines of a function syntax

@top10=terms("myfield",10)
  // request top 10 terms of "myfield", and return result under "top10"

So then the XML result from Solr would have something like this at the end:
<arr name="top10"><str>term1</str><str>term2</str><str>term3</str></arr>


@top10=termFreqs("myfield",10)   // request top 10 terms and their
frequencies
Returns:
<arr name="top10"><str>term1</str><int>142</int>...
  OR
<lst name="top10"><int name="term1">142</int>...


-Yonik


Re: List of indexed terms for a field

Posted by Yonik Seeley <ys...@gmail.com>.
On 6/7/06, Paul Terray <pt...@sollan.com> wrote:
> I am trying to make an index: Is there any way to get a list of all indexed
> terms for a field (especially a string or text one)?

Hi Paul,
There isn't currently a way to do this, except perhaps writing your
own custom request handler and using the lower level Lucene
TermEnumerator after getting your hands on the underlying IndexReader.

This feature has been on my wish-list though.
There needs to be a syntax to request info like this, and then the
implementation.

perhaps something along the lines of a function syntax

@top10=terms("myfield",10)
  // request top 10 terms of "myfield", and return result under "top10"

So then the XML result from Solr would have something like this at the end:
<arr name="top10"><str>term1</str><str>term2</str><str>term3</str></arr>


@top10=termFreqs("myfield",10)   // request top 10 terms and their frequencies
Returns:
<arr name="top10"><str>term1</str><int>142</int>...
  OR
<lst name="top10"><int name="term1">142</int>...


-Yonik

Re: List of indexed terms for a field

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Jun 7, 2006, at 3:45 AM, Paul Terray wrote:
> I am trying Solr for some projects and I am very impressed by its  
> simplicity
> and clarity of use.
>
>
>
> I am trying to make an index: Is there any way to get a list of all  
> indexed
> terms for a field (especially a string or text one)?

Out of the box Solr does not do this by default, but the core  
architecture of Solr makes this easy to add.

I've built a Google-Suggest-like drop down do this very thing.  All  
of my Solr code is currently going here:

	<http://svn.sourceforge.net/viewcvs.cgi/patacriticism/nines/trunk/ 
src/solr/org/nines/>

Particularly the FacetedSearchRequestHandler.java - where (prefix !=  
null).  In this particular case it's doing something a little  
interesting... a RAMDirectory was built into a custom Solr cache that  
indexes peoples names with tokenization and then returns just the  
names (not "documents").

Note: There are domain-centric things in there at the moment, with  
the grand idea to build any of these types of things into Solr when  
they are proven in the field.

	Erik