# ferret-0.11.8.5 Documentation

Ferret is a Ruby search library inspired by the Apache Lucene search engine for Java (jakarta.apache.org/lucene/). In the same way as Lucene, it is not a standalone application, but a library you can use to index documents and search for things in them later.

## Requirements

- Ruby 1.8

- C compiler to build the extension. Tested with gcc, VC6

- make (or nmake on windows)

## Installation

    $ sudo gem install ferret

If you don't have rubygems installed you can still install Ferret. Just download one of the zipped up versions of Ferret, unzip it and change into the unzipped directory. Then run the following set of commands;

    $ ruby setup.rb config
    $ ruby setup.rb setup
    $ sudo ruby setup.rb install

## Usage

You can read the TUTORIAL which you'll find in the same directory as this README. You can also check the following modules for more specific documentation.

- Ferret::Analysis: for more information on how the data is processed when it is tokenized. There are a number of things you can do with your data such as adding stop lists or perhaps a porter stemmer. There are also a number of analyzers already available and it is almost trivial to create a new one with a simple regular expression.

- Ferret::Search: for more information on querying the index. There are a number of already available queries and it's unlikely you'll need to create your own. You may however want to take advantage of the sorting or filtering abilities of Ferret to present your data the best way you see fit.

- Ferret::Document: to find out how to create documents. This part of Ferret is relatively straightforward. If you know how Strings, Hashes and Arrays work Ferret then you'll be able to create Documents.

- Ferret::QueryParser: if you want to find out more about what you can do with Ferret's Query Parser, this is the place to look. The query parser is one area that could use a bit of work so please send your suggestions.

- Ferret::Index: for more advanced access to the index you'll probably want to use the Ferret::Index::IndexWriter and Ferret::Index::IndexReader. This is the place to look for more information on them.

- Ferret::Store: This is the module used to access the actual index storage and won't be of much interest to most people.

### Performance

We are unaware of any alternatives that can out-perform Ferret while still matching it in features.

## Contact

For bug reports and patches I have set up Trac here;

    http://ferret.davebalmain.com/trac

Queries, discussion etc should be addressed to the mailing lists here;

    http://rubyforge.org/projects/ferret/

Alternatively you could create a new page for discussion on the Ferret wiki;

    http://ferret.davebalmain.com/trac

Of course, since Ferret was ported from Apache Lucene, most of what you can do with Lucene you can also do with Ferret.

## Authors

David Balmain

  Port to Ruby

The Apache Software Foundation (Doug Cutting and friends)

  Original Apache Lucene

## License

Ferret is available under an MIT-style license.

Copyright (c) 2005-2006 David Balmain

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

## Files

- MIT-LICENSE
- README
- TODO
- TUTORIAL

## Classes/Modules

- Ferret
- Ferret::BlankSlate
- Ferret::BoostMixin
- Ferret::Browser
- Ferret::Browser::Controller
- Ferret::Browser::Delegator
- Ferret::Browser::DocumentController
- Ferret::Browser::ErrorController
- Ferret::Browser::HelpController
- Ferret::Browser::HomeController
- Ferret::Browser::TermController
- Ferret::Browser::TermVectorController
- Ferret::Browser::ViewHelper
- Ferret::Document
- Ferret::Field
- Ferret::FieldSymbol
- Ferret::FieldSymbolMethods
- Ferret::FileNotFoundError
- Ferret::Index
- Ferret::Index::FieldInfo
- Ferret::Index::FieldInfos
- Ferret::Index::Index
- Ferret::Index::IndexReader
- Ferret::Index::IndexWriter
- Ferret::Index::LazyDoc
- Ferret::Index::LazyDoc::LazyDocData
- Ferret::Index::TermDocEnum
- Ferret::Index::TermEnum
- Ferret::Index::TermVector
- Ferret::Index::TermVector::TVOffsets
- Ferret::Index::TermVector::TVTerm
- Ferret::ParseError
- Ferret::QueryParser
- Ferret::QueryParser::QueryParseException
- Ferret::Search
- Ferret::Search::BooleanQuery
- Ferret::Search::BooleanQuery::BooleanClause
- Ferret::Search::ConstantScoreQuery
- Ferret::Search::Explanation
- Ferret::Search::Filter
- Ferret::Search::FilteredQuery
- Ferret::Search::FuzzyQuery
- Ferret::Search::Hit
- Ferret::Search::MatchAllQuery
- Ferret::Search::MultiSearcher
- Ferret::Search::MultiTermQuery
- Ferret::Search::PhraseQuery
- Ferret::Search::PrefixQuery
- Ferret::Search::Query
- Ferret::Search::QueryFilter
- Ferret::Search::RangeFilter
- Ferret::Search::RangeQuery
- Ferret::Search::Searcher
- Ferret::Search::Sort
- Ferret::Search::SortField
- Ferret::Search::Spans
- Ferret::Search::Spans::SpanFirstQuery
- Ferret::Search::Spans::SpanMultiTermQuery
- Ferret::Search::Spans::SpanNearQuery
- Ferret::Search::Spans::SpanNotQuery
- Ferret::Search::Spans::SpanOrQuery
- Ferret::Search::Spans::SpanPrefixQuery
- Ferret::Search::Spans::SpanTermQuery
- Ferret::Search::TermQuery
- Ferret::Search::TopDocs
- Ferret::Search::TypedRangeFilter
- Ferret::Search::TypedRangeQuery
- Ferret::Search::WildcardQuery
- Ferret::StateError
- Ferret::Store
- Ferret::Store::Directory
- Ferret::Store::FSDirectory
- Ferret::Store::Lock
- Ferret::Store::Lock::LockError
- Ferret::Store::RAMDirectory
- WEBrick
- WEBrick::FerretBrowserHandler
- Date
- DateTime
- FileUtils
- Float
- Integer
- String
- Symbol
- Time

## Methods

- ::default_max_terms — Ferret::Search::MultiTermQuery
- ::default_max_terms= — Ferret::Search::MultiTermQuery
- ::default_min_similarity — Ferret::Search::FuzzyQuery
- ::default_min_similarity= — Ferret::Search::FuzzyQuery
- ::default_prefix_length — Ferret::Search::FuzzyQuery
- ::default_prefix_length= — Ferret::Search::FuzzyQuery
- ::load — Ferret::Index::FieldInfos
- ::new — Ferret::Search::MatchAllQuery
- ::new — Ferret::Index::IndexReader
- ::new — Ferret::Search::Spans::SpanMultiTermQuery
- ::new — Ferret::Search::TermQuery
- ::new — Ferret::Store::FSDirectory
- ::new — Ferret::Search::MultiSearcher
- ::new — Ferret::QueryParser
- ::new — Ferret::Search::Spans::SpanTermQuery
- ::new — Ferret::Document
- ::new — Ferret::Search::Spans::SpanNotQuery
- ::new — Ferret::Search::Spans::SpanFirstQuery
- ::new — Ferret::Search::Spans::SpanNearQuery
- ::new — Ferret::Field
- ::new — Ferret::Search::BooleanQuery
- ::new — Ferret::Search::FilteredQuery
- ::new — Ferret::Search::ConstantScoreQuery
- ::new — Ferret::Store::RAMDirectory
- ::new — Ferret::Browser::Controller
- ::new — Ferret::Index::FieldInfos
- ::new — Ferret::Search::Searcher
- ::new — Ferret::Search::FuzzyQuery
- ::new — Ferret::Search::BooleanQuery::BooleanClause
- ::new — Ferret::Search::Spans::SpanOrQuery
- ::new — Ferret::Search::RangeQuery
- ::new — Ferret::Search::TypedRangeQuery
- ::new — Ferret::Search::PhraseQuery
- ::new — Ferret::Search::Sort
- ::new — Ferret::Index::FieldInfo
- ::new — Ferret::Index::IndexWriter
- ::new — Ferret::Search::PrefixQuery
- ::new — Ferret::FieldSymbol
- ::new — Ferret::Search::SortField
- ::new — Ferret::Index::Index
- ::new — Ferret::Search::WildcardQuery
- ::new — Ferret::Browser::Delegator
- ::new — Ferret::Search::QueryFilter
- ::new — Ferret::Search::TypedRangeFilter
- ::new — Ferret::Search::RangeFilter
- ::new — Ferret::Search::Spans::SpanPrefixQuery
- ::new — WEBrick::FerretBrowserHandler
- ::new — Ferret::Search::MultiTermQuery
- #+ — Ferret::Field
- #<< — Ferret::Index::FieldInfos
- #<< — Ferret::Search::PhraseQuery
- #<< — Ferret::Search::MultiTermQuery
- #<< — Ferret::Index::Index
- #<< — Ferret::Search::Spans::SpanOrQuery
- #<< — Ferret::Search::BooleanQuery
- #<< — Ferret::Search::Spans::SpanNearQuery
- #<< — Ferret::Index::IndexWriter
- #== — Ferret::Document
- #== — Ferret::Field
- #== — Ferret::Search::Query
- #=~ — Float
- #[] — Ferret::Search::Searcher
- #[] — Ferret::Index::Index
- #[] — Ferret::Index::FieldInfos
- #[] — Ferret::Index::IndexReader
- #add — Ferret::Search::Spans::SpanOrQuery
- #add — Ferret::Index::FieldInfos
- #add — Ferret::Search::Spans::SpanNearQuery
- #add_document — Ferret::Index::Index
- #add_document — Ferret::Index::IndexWriter
- #add_field — Ferret::Index::FieldInfos
- #add_indexes — Ferret::Index::Index
- #add_query — Ferret::Search::BooleanQuery
- #add_readers — Ferret::Index::IndexWriter
- #add_term — Ferret::Search::MultiTermQuery
- #add_term — Ferret::Search::PhraseQuery
- #analyzer — Ferret::Index::IndexWriter
- #analyzer= — Ferret::Index::IndexWriter
- #batch_update — Ferret::Index::Index
- #bits — Ferret::Search::Filter
- #boost — Ferret::Index::FieldInfo
- #boost — Ferret::Search::Query
- #boost= — Ferret::Search::Query
- #chunk_size — Ferret::Index::IndexWriter
- #chunk_size= — Ferret::Index::IndexWriter
- #close — Ferret::Index::IndexReader
- #close — Ferret::Search::Searcher
- #close — Ferret::Index::Index
- #close — Ferret::Index::IndexWriter
- #close — Ferret::Store::Directory
- #commit — Ferret::Index::IndexWriter
- #commit — Ferret::Index::IndexReader
- #commit — Ferret::Index::Index
- #comparator — Ferret::Search::SortField
- #compressed? — Ferret::Index::FieldInfo
- #create_index — Ferret::Index::FieldInfos
- #default — Ferret::Index::LazyDoc
- #delete — Ferret::Index::IndexReader
- #delete — Ferret::Index::IndexWriter
- #delete — Ferret::Index::Index
- #delete — Ferret::Store::Directory
- #deleted? — Ferret::Index::Index
- #deleted? — Ferret::Index::IndexReader
- #desc — Ferret::FieldSymbolMethods
- #desc? — Ferret::FieldSymbolMethods
- #do_GET — WEBrick::FerretBrowserHandler
- #doc — Ferret::Index::Index
- #doc — Ferret::Index::TermDocEnum
- #doc_count — Ferret::Index::IndexWriter
- #doc_freq — Ferret::Index::TermEnum
- #doc_freq — Ferret::Search::Searcher
- #doc_freq — Ferret::Index::IndexReader
- #doc_skip_interval — Ferret::Index::IndexWriter
- #doc_skip_interval= — Ferret::Index::IndexWriter
- #each — Ferret::Index::FieldInfos
- #each — Ferret::Index::Index
- #each — Ferret::Index::TermEnum
- #each — Ferret::Index::TermDocEnum
- #each_position — Ferret::Index::TermDocEnum
- #ensure_reader_open — Ferret::Index::Index
- #ensure_searcher_open — Ferret::Index::Index
- #ensure_writer_open — Ferret::Index::Index
- #eql? — Ferret::Search::Query
- #eql? — Ferret::Field
- #eql? — Ferret::Document
- #exists? — Ferret::Store::Directory
- #explain — Ferret::Search::Searcher
- #explain — Ferret::Index::Index
- #field= — Ferret::Index::TermEnum
- #field_infos — Ferret::Index::IndexWriter
- #field_infos — Ferret::Index::IndexReader
- #field_infos — Ferret::Index::Index
- #field_names — Ferret::Index::IndexReader
- #fields — Ferret::QueryParser
- #fields — Ferret::Index::IndexReader
- #fields — Ferret::Search::Sort
- #fields — Ferret::Index::FieldInfos
- #fields — Ferret::Index::LazyDoc
- #fields= — Ferret::QueryParser
- #file_count — Ferret::Store::Directory
- #flush — Ferret::Index::Index
- #freq — Ferret::Index::TermDocEnum
- #get_document — Ferret::Index::IndexReader
- #get_document — Ferret::Search::Searcher
- #get_norms_into — Ferret::Index::IndexReader
- #has_deletions? — Ferret::Index::Index
- #has_deletions? — Ferret::Index::IndexReader
- #has_norms? — Ferret::Index::FieldInfo
- #hash — Ferret::Search::Query
- #highlight — Ferret::Search::Searcher
- #highlight — Ferret::Index::Index
- #index — Ferret::Browser::ErrorController
- #index — Ferret::Browser::DocumentController
- #indexed? — Ferret::Index::FieldInfo
- #latest? — Ferret::Index::IndexReader
- #list — Ferret::Browser::DocumentController
- #load — Ferret::Index::LazyDoc
- #load_page — Ferret::Browser::Controller
- #locked? — Ferret::Store::Lock
- #make_lock — Ferret::Store::Directory
- #max_buffer_memory — Ferret::Index::IndexWriter
- #max_buffer_memory= — Ferret::Index::IndexWriter
- #max_buffered_docs — Ferret::Index::IndexWriter
- #max_buffered_docs= — Ferret::Index::IndexWriter
- #max_doc — Ferret::Search::Searcher
- #max_doc — Ferret::Index::IndexReader
- #max_field_length — Ferret::Index::IndexWriter
- #max_field_length= — Ferret::Index::IndexWriter
- #max_merge_docs — Ferret::Index::IndexWriter
- #max_merge_docs= — Ferret::Index::IndexWriter
- #merge_factor — Ferret::Index::IndexWriter
- #merge_factor= — Ferret::Index::IndexWriter
- #method_missing — Ferret::Browser::Controller
- #method_missing — Ferret::FieldSymbol
- #min_similarity — Ferret::Search::FuzzyQuery
- #name — Ferret::Search::SortField
- #name — Ferret::Index::FieldInfo
- #next? — Ferret::Index::TermEnum
- #next? — Ferret::Index::TermDocEnum
- #next_position — Ferret::Index::TermDocEnum
- #norms — Ferret::Index::IndexReader
- #num_docs — Ferret::Index::IndexReader
- #obtain — Ferret::Store::Lock
- #occur= — Ferret::Search::BooleanQuery::BooleanClause
- #omit_norms? — Ferret::Index::FieldInfo
- #optimize — Ferret::Index::Index
- #optimize — Ferret::Index::IndexWriter
- #paginate — Ferret::Browser::Controller
- #parse — Ferret::QueryParser
- #persist — Ferret::Index::Index
- #prefix_length — Ferret::Search::FuzzyQuery
- #process_query — Ferret::Index::Index
- #prohibited? — Ferret::Search::BooleanQuery::BooleanClause
- #query — Ferret::Search::BooleanQuery::BooleanClause
- #query= — Ferret::Search::BooleanQuery::BooleanClause
- #query_delete — Ferret::Index::Index
- #query_update — Ferret::Index::Index
- #reader — Ferret::Index::Index
- #reader — Ferret::Search::Searcher
- #refresh — Ferret::Store::Directory
- #release — Ferret::Store::Lock
- #rename — Ferret::Store::Directory
- #render — Ferret::Browser::Controller
- #required? — Ferret::Search::BooleanQuery::BooleanClause
- #reverse? — Ferret::Search::SortField
- #run — Ferret::Browser::Delegator
- #scan — Ferret::Search::Searcher
- #scan — Ferret::Index::Index
- #score — Ferret::Search::Explanation
- #search — Ferret::Index::Index
- #search — Ferret::Search::Searcher
- #search_each — Ferret::Index::Index
- #search_each — Ferret::Search::Searcher
- #searcher — Ferret::Index::Index
- #seek — Ferret::Index::TermDocEnum
- #seek_term_enum — Ferret::Index::TermDocEnum
- #set_field — Ferret::Index::TermEnum
- #set_norm — Ferret::Index::IndexReader
- #show — Ferret::Browser::TermController
- #show — Ferret::Browser::DocumentController
- #size — Ferret::Index::Index
- #size — Ferret::Index::FieldInfos
- #skip_to — Ferret::Index::TermDocEnum
- #skip_to — Ferret::Index::TermEnum
- #slop — Ferret::Search::PhraseQuery
- #slop= — Ferret::Search::PhraseQuery
- #store_offsets? — Ferret::Index::FieldInfo
- #store_positions? — Ferret::Index::FieldInfo
- #store_term_vector? — Ferret::Index::FieldInfo
- #stored? — Ferret::Index::FieldInfo
- #term — Ferret::Index::TermEnum
- #term_count — Ferret::Index::IndexReader
- #term_docs — Ferret::Index::IndexReader
- #term_docs_for — Ferret::Index::IndexReader
- #term_index_interval — Ferret::Index::IndexWriter
- #term_index_interval= — Ferret::Index::IndexWriter
- #term_positions — Ferret::Index::IndexReader
- #term_positions_for — Ferret::Index::IndexReader
- #term_vector — Ferret::Index::IndexReader
- #term_vector — Ferret::Index::Index
- #term_vectors — Ferret::Index::IndexReader
- #termdocs — Ferret::Browser::TermController
- #terms — Ferret::Search::Query
- #terms — Ferret::Index::IndexReader
- #terms_from — Ferret::Index::IndexReader
- #tick_or_cross — Ferret::Browser::ViewHelper
- #to_a — Ferret::Index::FieldInfos
- #to_date_lex — String
- #to_date_time_lex — String
- #to_html — Ferret::Search::Explanation
- #to_i_lex — String
- #to_json — Ferret::Index::TermDocEnum
- #to_json — Ferret::Search::TopDocs
- #to_json — Ferret::Index::TermEnum
- #to_s — Ferret::Field
- #to_s — Ferret::Search::BooleanQuery::BooleanClause
- #to_s — Ferret::Search::Sort
- #to_s — Ferret::Index::Index
- #to_s — Ferret::Search::Filter
- #to_s — Ferret::Search::TopDocs
- #to_s — Ferret::Document
- #to_s — Ferret::Search::Query
- #to_s — Ferret::Index::FieldInfo
- #to_s — Ferret::Search::SortField
- #to_s — Ferret::Search::Explanation
- #to_s — Ferret::Index::FieldInfos
- #to_s_lex — DateTime
- #to_s_lex — Integer
- #to_s_lex — Time
- #to_s_lex — Date
- #to_s_pad — Integer
- #to_time_lex — String
- #tokenized? — Ferret::Index::FieldInfo
- #tokenized_fields — Ferret::Index::FieldInfos
- #tokenized_fields — Ferret::Index::IndexReader
- #tokenized_fields — Ferret::QueryParser
- #tokenized_fields= — Ferret::QueryParser
- #touch — Ferret::Store::Directory
- #truncate — Ferret::Browser::ViewHelper
- #type — Ferret::Search::SortField
- #type — Ferret::FieldSymbolMethods
- #undelete_all — Ferret::Index::IndexReader
- #update — Ferret::Index::Index
- #use_compound_file — Ferret::Index::IndexWriter
- #use_compound_file= — Ferret::Index::IndexWriter
- #version — Ferret::Index::IndexReader
- #version — Ferret::Index::IndexWriter
- #while_locked — Ferret::Store::Lock
- #writer — Ferret::Index::Index

[Validate]

Generated with the Darkfish Rdoc Generator 2.