Friday, March 8, 2019

Full Text Search in Ruby

full(a) text inquisition is a technique for depending a put down or database stored in the computer. A full text hunting locomotive engine examines all the words, in every stored document, to find a match of the keyword searched by the wasting diseaser. Many meshing lays and lotion programs provide full-text search capabilities. There are quite a few excerptions when it adds to adding a full text search in a Ruby on Rails application. A choice rouse be made on the basis of the language the search engine is create verbally in or the scalability options suited for the application.Acts As Indexed beingness a pure Ruby implementation makes for a tool that is on the whole portable, and suitable for almost any application requiring full text search capabilities. Search queries support many standard boolean operators, namely ejection of a term through the use of - and the matching of phrases through the use of quotation marks. It is useful in case of a simple site and aff ect to implement a basic search very quickly. black-footed ferret is a full text search engine library indite for ruby implemented in a rails application by the Acts As Ferret plugin.It is inspired by the Apache Lucene java project. The first flavour to implementing a search is to get an forefinger built and then the index is searched for the documents having the keyword. One of the more useful features especially in a web scenario is suck uping the matched words. This is made trivial by Indexs highlight method. Its also possible to use Ferret as a more general purpose data store Xapian is written in C++ with bindings to allow use from Perl, Python, PHP, Java, Tcl, C and Ruby.An important feature of Xapian is the be probabilistic search important words get more slant than unimportant words so more relevant results appear at the top. It also supports Synonyms as an automatic form of query expansion and provoke even suggest spelling corrections for user supplied queries. Ful l area of structured boolean search operators (stock NOT market, etc). Sphinx, written in C++, is the most logical successor to Ultrasphinx, since both hire Sphinx as the search server.Sphinx works by reading information come on of the database to build the search index. Communication with the Sphinx server occurs by sharing C objects over sockets. A variety of text processing features enable fine-tuning Sphinx for application requirements, and a number of relevance functions ensures you can tweak search theatrical role as well. Sunspot is a Ruby library for expressive, powerful interaction with the Solr search engine. Sunspot uses Solr, a Java search server built on the Lucene search library.It provides robust, flexible full-text search with no boolean queries and no string programming. Solr servers can be clustered and since they manage the index, Sunspot can automatically update the indexes when the model objects change. Theres no need to run a cron job to reindex the data o r setup delta index like with Sphinx. Thus we see that Full text search has come a long way since the early days of Ferret. The incompatibility of Ultrasphinx, one time the most preferred, with Rails 3. resulted in the emergence of Sphinx and Sunspot as favourites. Solr is a compelling alternative to Sphinx, since the most scalable Web apps (Facebook, Twitter) use Java behind the UI layer. Xapian can be considered as the best option whenever be probabilistic search is required. Acts_As_Indexed, written entirely in Ruby, works pop out great and is very easy to implement with automatic indexing. (ie No cron jobs needful to keep the index up to date).

No comments:

Post a Comment