# Iterate through an entire index

**URL:** <https://www.ruby-forum.com/t/iterate-through-an-entire-index/105557>\
**Category:** Ferret\
**Created:** [May 31, 2007, 3:10am UTC](https://www.ruby-forum.com/t/iterate-through-an-entire-index/105557 "2007-05-31T03:10:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmaenpaa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9de053/32.png) [@jmaenpaa](https://www.ruby-forum.com/u/jmaenpaa)\
**Post date:** [May 31, 2007, 3:10am UTC](https://www.ruby-forum.com/t/iterate-through-an-entire-index/105557/1 "2007-05-31T03:10:11Z")

</div>

I’m trying to get all the documents in an index. I’ve been hunting  
around, but I don’t see a clear way to do this. I can get docs by  
searching on a term, or by specific doc id, but having trouble getting  
the whole pile of them. I’m using AAF and Ferret 0.11.4. Any help  
appreciated.

John

---

<div class="post-metadata">

**Author:** ![jmaenpaa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9de053/32.png) [@jmaenpaa](https://www.ruby-forum.com/u/jmaenpaa)\
**Post date:** [May 31, 2007, 9:57am UTC](https://www.ruby-forum.com/t/iterate-through-an-entire-index/105557/2 "2007-05-31T09:57:29Z")

</div>

On May 31, 2007, at 03:10, John Mcgrath wrote:

> I’m trying to get all the documents in an index. I’ve been hunting  
> around, but I don’t see a clear way to do this. I can get docs by  
> searching on a term, or by specific doc id, but having trouble getting  
> the whole pile of them. I’m using AAF and Ferret 0.11.4. Any help  
> appreciated.

Ferret 0.11.4 introduced a ferret-browser (try ferret- browser on the  
shell)

the code for the ferret browser is part of the gem and is entirely in  
ruby …  
you should find an example on how to iterate through all documents in  
that code … if you cant find it, i can take a look for you …

Ben

---

<div class="post-metadata">

**Author:** ![jmaenpaa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9de053/32.png) [@jmaenpaa](https://www.ruby-forum.com/u/jmaenpaa)\
**Post date:** [June 1, 2007, 6:10am UTC](https://www.ruby-forum.com/t/iterate-through-an-entire-index/105557/3 "2007-06-01T06:10:10Z")

</div>

> > I’m trying to get all the documents in an index. I’ve been hunting  
> > around, but I don’t see a clear way to do this. I can get docs by  
> > searching on a term, or by specific doc id, but having trouble getting  
> > the whole pile of them. I’m using AAF and Ferret 0.11.4. Any help  
> > appreciated.
> 
> Ferret 0.11.4 introduced a ferret-browser (try ferret- browser on the  
> shell)
> 
> the code for the ferret browser is part of the gem and is entirely in  
> ruby …  
> you should find an example on how to iterate through all documents in  
> that code … if you cant find it, i can take a look for you …

Ben, thanks a million, that’s exactly what I was looking for. And the  
ferret browser is rad!

In case anyone’s curious, the code is here:  
[http://ferret.davebalmain.com/trac/browser/trunk/ruby/lib/ferret/browser.rb?rev=750](http://ferret.davebalmain.com/trac/browser/trunk/ruby/lib/ferret/browser.rb?rev=750)  
(in the DocumentController#list method)

and here:

[http://ferret.davebalmain.com/trac/browser/trunk/ruby/lib/ferret/browser/views/document/list.rhtml?rev=750](http://ferret.davebalmain.com/trac/browser/trunk/ruby/lib/ferret/browser/views/document/list.rhtml?rev=750)
